preg_match and exact match



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

    $q2d - it is (chocolate-spritz)

    $ussssrl - this 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.

    I mean.

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

    +++++++++++++++

    chocolate-spritz

    .../chocolate-spritz/

    .../chocolate-spritz

    Maybe after the gap or something. /



  • Please use special services. http://regexr.com/3cikn ♪ A slash or a gap after the phrase is added to the template.

    /(chocolate-spritz)[ \/]/
    

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2