更新时间:2023-02-23 09:20:46
嗯,我稍微修改了一下第一个表达式,因为我认为有一些额外的捕获组,然后通过添加提前查找技巧来创建它们:
-第一个(Live demo):
(vitae)(?![^[]*]s*()
-第二个(Live demo):
{{([^}}]+)}}[[[^]]]+]](?=[^[]*]s*()
前视部件说明:
(?! # Starting a negative lookahead
[^[]*] # Everything that's between brackets
s* # Any whitespace
( # Check if it's followed by an opening parentheses
) # End of lookahead which confirms the whole expression doesn't match between brackets
(?=
表示积极向前看