Regular Expression to exclude set of Keywords

kae picture kae · Sep 22, 2008 · Viewed 87.9k times · Source

I want an expression that will fail when it encounters words such as "boon.ini" and "http". The goal would be to take this expression and be able to construct for any set of keywords.

Answer

Tim Pietzcker picture Tim Pietzcker · Sep 22, 2008
^(?:(?!boon\.ini|http).)*$\r?\n?

(taken from RegexBuddy's library) will match any line that does not contain boon.ini and/or http. Is that what you wanted?