正则表达式解释:(?> [^<>] +)

时间:2011-04-05 22:45:58

标签: php regex pcre

这应该如何解释,/(?>[^<>]+)/? (PHP RegEx引擎)

谢谢。

1 个答案:

答案 0 :(得分:4)

(?>        # I had to look this up, but apparently this syntax prevents the regex
           # parser from backtracking into whatever is matched in this group if 
           # the rest of the  pattern fails
   [^<>]+  # match ANY character except '<' or '>', 1 or more times. 
         ) # close non-backtrackable group.

对于只对一次性模式感兴趣的人,请查看http://www.regextester.com/pregsyntax.html

中的Once-only subpatterns部分