Friday, September 11, 2020

How to negate specific word in regex?

 https://stackoverflow.com/questions/1240275/how-to-negate-specific-word-in-regex

A great way to do this is to use negative lookahead:
^(?!.*bar).*$

No comments:

Post a Comment