如何克服preg_match“偏移量大于主题长度”?

时间:2018-07-02 12:54:20

标签: php regex preg-match regex-lookarounds

模式~(\w+-?)+[0-9]+(?=\.html)~www.test.com/this/works/12345678901234567/2009/08/2009819107554384978.html上返回false

但是它在www.test.com/this/works/12345678901234567/2009/08/200981910755438497.html上返回1(少一个字符)。

PHP文档内容如下:

  

“如果偏移量大于主题长度,则返回FALSE。”

怎么办?

Live test here

0 个答案:

没有答案
相关问题