Good afternoon, good people. In regular expressions recently, one line is tormenting ... well, it does not give way either.
preg_match("/^([A-z_0-9\$\s\-]+)(|\-([a-z24]+))$/i", $urlprop['func'], $urllogin22); This is the regular line itself.
In urlprop, the url string is stored, in which there can be 2 positions:
- Product Name
- TitleProduct-Option
The problem lies in the fact that the name of the product may contain a dash "-" and the regular schedule no longer splits the URL into "the name of the goods" and "Option."
Tell me what is wrong in my expression and how could this be corrected?
названиеТовараgoods always has this format? That is, the name of the product is always written on the camel case? If you can, give an example of a real name. - Edward