正则表达式 - php正则问题

WBOY
Release: 2016-06-06 20:24:12
Original
1344 people have browsed it

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

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

回复内容:

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

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

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template