No ending delimiter '/' found error

后端 未结 3 932
南旧
南旧 2021-01-19 05:17

I have adjusted a small script to check backlinks. Yet I keep on getting the error

Warning: preg_match() [function.preg-match]: No ending delimiter \'/\' found in li

相关标签:
3条回答
  • 2021-01-19 05:56

    The error is very clear really, you didn't include the trailing /:

    preg_match('/<div id="resultStats">About \(.*?)\ /',$v,$s);
    

    I honestly doubt your escape characters are well placed though. Maybe you meant \)?

    0 讨论(0)
  • 2021-01-19 05:58

    Try changing preg_match('/<div id="resultStats">About \(.*?)\ ',$v,$s);

    To preg_match('/<div id="resultStats">About \(.*?)\ /',$v,$s);

    / is a "delimiter" meaning it tells preg_match where the regex pattern ends.

    0 讨论(0)
  • 2021-01-19 06:08

    It does not have a closing /

    preg_match('/ pattern /', $subject);

    You have a beginning (slash) / but no closing (slash) /

    It looks for the pattern you define in between the 2 slashes.

    0 讨论(0)
提交回复
热议问题