Home  >  Article  >  Backend Development  >  正则表达式 - php正则问题

正则表达式 - php正则问题

WBOY
WBOYOriginal
2016-06-06 20:24:121303browse

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

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

回复内容:

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

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

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

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn