Regular expression to match a line that doesn't contain a word

 Suppose we have 3 lines and looking “bsd” word if not having in the line only pick those lines.


Hellodhkbuysd

bsdUTYd

amZubadys


Answer =  

Hellodhkbuysd

amZubadys



Solution:


#1 JavaScript syntax

/^(?!.*bsd)/m   


#2 without bsd

^(?:(?!bsd).)*$

#3 

^((?!bsd).)*$




Comments