if (preg_match('/'.$q2d.'/i', $ussssrl)) 

$q2d is (chocolate-spritz)

$ussssrl is:

 www.cooks.com/recipe/wt3s285h/chocolate-spritz-cookies.html www.keyingredient.com/recipes/681141330/chocolate-spritz/ www.dominosugar.com/recipe/chocolate-spritz-cookies-272 

how to find an exact match

those.

 www.keyingredient.com/recipes/681141330/chocolate-spritz/ +++++++++++++++ chocolate-spritz .../chocolate-spritz/ .../chocolate-spritz 

Maybe after a match space or /

  • And you give the criteria for "exact match". because your substring is in all given. but you probably want to focus on obliques. Well, then look for a line with slashes, but of course shield them. so that the final expression turns out to be '/\/chocolate-spritz\//' - Mike

1 answer 1

Please use special services. Your example . A slash or space after the phrase has been added to the template.

 /(chocolate-spritz)[ \/]/