Tec(h)tonic

Insights into building a solid I.T. foundation in the mid-size business world.

grep search for lines that do NOT contain certain words

Of course, all it took was a little Google searching to find the answer to this, but I never bothered to do it until today – this is a lifesaver:

^((?!hede).)*$

The regex above will match any string, or line without a line break, not containing the (sub)string ‘hede’.

Thanks to this post for this gem.


Leave a Reply

Your email address will not be published. Required fields are marked *