Regex Matching Line Not Containing the String

Regex Matching Line Not Containing the String

I'd like to select a lines with does not contain a word SCREEN. I tried the following regex (?<!SCREEN).+ but it seems not to work - selects all the lines. Why doesn't it work?

1

2 Answers

The short answer: ^((?!SCREEN).)*$

This is inspired by which contains a full explanation

1

Another try for this case: (SCREEN){0}.*$

Hope that can help.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett
Author

Chloe Bennett

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.