How can I make Preg Match to Search Strings With .
, '
,"
and #
? I tried used the following code but it doesnt work if the string contains .
, `' .
(preg_match("/\b".preg_quote($txtsize,'/')."\b/i", $row['ItemDescription'])
Using the above code i couldnt get this on Search 31X15.50-15 12 PLY TRAXION HF2
or 31X15.50
or 1.75"X11.500"
or
Thank you
You can use a regex like this:
Graphically is more understandable...
Working demo
You can use this code
However, if you want to pass these strings:
You'll have to allow spaces, hyphens and numbers in your regex, so you'll have to use: