Mordachai
Mordachai

Reputation: 9662

How to search for all lines that start with a pattern, but then don't have another following pattern?

The selection I want is:

pushbutton.*

but I don't want any selection that includes 'justify_cell' within it

(?!.*justify_cell)

I can get select all lines that don't include 'justify_cell'

^(?!.*justify_cell).*$

But I cannot seem to hit on a way to select from pushbutton to end of line if it doesn't include 'justify_cell'

Upvotes: 2

Views: 21

Answers (1)

Mordachai
Mordachai

Reputation: 9662

I was being a dummy - but the basic answer seems to be:

^(?!.*justify_cell).*(pushbutton.*)$

Upvotes: 1

Related Questions