好的,尝试使用此正则表达式:
(text|simple)(?![^<]*>|[^<>]*</)
分解:
( # Open capture group text # Match 'text'| # Or simple # Match 'simple') # End capture group(?! # Negative lookahead start (will cause match to fail if contents match) [^<]* # Any number of non-'<' characters > # A > character| # Or [^<>]* # Any number of non-'<' and non-'>' characters </ # The characters < and /) # End negative lookahead.
text还是
simple是HTML标记之间。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)