If you are familiar with regular expressions and use repeated expressions in 0-width assertions *, an error will be reported. PHPcodepreg_match (#(? & Lt; a *) word #, preword, $ mt); preg_match (#(? & Lt; (w +) & gt ;).*(? & Lt; 1 & gt;) #, pre & lt; a & gt; hi! & Lt; a & gt; word, $ m when familiar with regular expressions come in, the 0-width assertion repeats * will report an error
Let's take a look at the two.
PHP code
Preg_match ('#(? <= A *) word # ', 'pre word', $ mt); preg_match ('#(? <= <(\ W +)> ).*(? = <\/\ 1>) # ', 'prehi! Word', $ mt );
------ Solution --------------------
Http://perldoc.perl.org/perlretut.html#Looking-ahead-and-looking-behind
This is a perl regular expression document and I think it should be applicable to the php regular expression engine.
The lookahead assertion is denoted (? = Regexp) and the lookbehind assertion is denoted (? <= Fixed-regexp)
The zero-width assertion is also called the loop View. the above meaning is that the reverse-order loop view can only contain a fixed-length subexpression, so it cannot appear *? + These quantifiers are only available for sequential view.