\@! Matches with zero width if the preceding atom does NOT match at the
current position. /zero-width {not in Vi}
Like "(?!pattern)" in Perl.
Example matches
foo\(bar\)\@! any "foo" not followed by "bar"
a.\{-}p\@! "a", "ap", "app", "appp", etc. not immediately
followed by a "p"
if \(\(then\)\@!.\)*$ "if " not followed by "then"
current position. /zero-width {not in Vi}
Like "(?!pattern)" in Perl.
Example matches
foo\(bar\)\@! any "foo" not followed by "bar"
a.\{-}p\@! "a", "ap", "app", "appp", etc. not immediately
followed by a "p"
if \(\(then\)\@!.\)*$ "if " not followed by "then"
正则表达式零宽断言详解
本文详细介绍了正则表达式中的零宽断言概念及其应用方式,通过具体的例子展示了如何使用零宽断言来匹配特定模式,但不包括这些模式本身,从而实现更为复杂的文本匹配。
1093

被折叠的 条评论
为什么被折叠?



