Jam
Jam

Reputation: 11

Extended Search

So I've got a big text file which looks like the following:

text;text;text;text;text - 5 words
text;text;text;text;text;text - 6 words
text;text;text;text;text;text;text - 7 words

How i can search lines with 6, 7,... words?

I try search with (.*);(.*);(.*);(.*);(.*);(.*); but not work :(

Upvotes: 0

Views: 1843

Answers (2)

jiggy
jiggy

Reputation: 3826

Don't abuse the *. If you are trying to match at least one character, .+ is less ambiguous. In fact, if ; is the separator, you can try [^;]+ to be even more pedantic.

Upvotes: 0

BoltClock
BoltClock

Reputation: 723568

Note: Notepad++ does choke on my existing regex, but the OP adapted it to suit his need, see the comments for more.

First of all, you should be doing a regular expression search, not an extended search.

Here's the regex. Basically you match the first 5 words, then match at least one more after the first 5 (if you don't need to match the last semicolon, take out the ;?):

(.*);(.*);(.*);(.*);(.*)(;(.*))+;?

(You cannot use (.*)(;(.*)){5,} as Notepad++ doesn't support that syntax.)

Upvotes: 1

Related Questions