ab11
ab11

Reputation: 20100

Using regex File Search, how to search across new lines?

I would like my File Search to find occurrences of insert name, regardless of interceding characters or new lines. I would like to find both:

insert into name

insert into name

insert.*name - works for the first occurrence but not the second

(?s)insert.*name - fails to find either line

insert((.|\n)*)name - gives an error

Upvotes: 1

Views: 33

Answers (1)

howlger
howlger

Reputation: 34255

Use [\s\S] instead of .:

insert[\s\S]*name

or not greedy (if in insert name - insert name there should be two matches instead of one match of the whole sentence):

insert[\s\S]*?name

Upvotes: 1

Related Questions