PHP8.1.21版本已发布
vue8.1.21版本已发布
jquery8.1.21版本已发布

正则表达式 - php正则问题

原创
2016-06-06 20:24:12 970浏览

   preg_match("/(?).*?(?=)/", $html, $result);

报错
preg_match(): Compilation failed: lookbehind assertion is not fixed length at offset 24
是为啥呢?
就是\s*那里,php的正则不是这样写嘛?

回复内容:

   preg_match("/(?).*?(?=)/", $html, $result);

报错
preg_match(): Compilation failed: lookbehind assertion is not fixed length at offset 24
是为啥呢?
就是\s*那里,php的正则不是这样写嘛?

后瞻断言的内容被严格限制为只能用于匹配定长字符串。

http://php.net/manual/zh/regexp.reference.assertions.php

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。