佚名通过本文主要向大家介绍了php面试问题,php乱码问题,php路径问题,php答辩问题,php面试问题及答案等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题:php正则问题
描述:
解决方案1:
描述:
preg_match("/(?<=<p\s*class=\"text15\">).*?(?=<\/p>)/", $html, $result);
报错
preg_match(): Compilation failed: lookbehind assertion is not fixed length at offset 24
是为啥呢?
就是\s*那里,php的正则不是这样写嘛?
解决方案1:
后瞻断言的内容被严格限制为只能用于匹配定长字符串。
http://php.net/manual/zh/regexp.reference.assertions.php