Problem:
To find/match all text lines that do not contain a specific string.
For example find/match all lines in a text document that do not contain word “constant”.
Solution:
^(.(?!stringToExclude))*$
or ^(.(?!constant))*$ with respect to the above example to exclude word “constant”.
Another example: in a text document containing email addresses (one address per
Read full article from RegEx – Exclude a String | Fine Only Solutions
No comments:
Post a Comment