(?:(?!X).)*
where
X
can be any regular expression.This is using a lookahead assertion, more specifically a negative lookahead. Explanation:
(?: # Match the following any number of times:
(?!lazy) # (first assert that it's not possible to match "lazy" here
. # then match any character
)* # end of group, zero or more repetitions.
No comments:
Post a Comment