开发者

Regular Expression explanation: (?>[^<>]+)

开发者 https://www.devze.com 2023-02-22 02:27 出处:网络
How should this, /(?>[^<>]+)/, be interpreted开发者_运维问答 please? (PHP RegExp Engine)

How should this, /(?>[^<>]+)/, be interpreted开发者_运维问答 please? (PHP RegExp Engine)

Thank you.


(?>        # 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.

For anyone interested in the once-only pattern, check out the section Once-only subpatterns in http://www.regextester.com/pregsyntax.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号