Arthis
Arthis

Reputation: 77

Wildcard search that retains wildcard match

I'm trying to parse a text file in notepad++ to find any instance of a group ID:

id=group00001

... with the intention of adding a newline after each.

As group IDs are different each time (but always 5 characters) I gather I need to use regular expression searches for wildcards. But I'm struggling to find a way to do so without wiping out the ID.

For instance, a find and replace as follows:

Find: id=group.....
Replace: id=group.....\r\n

Finds all of them, but replaces the ID with ".....".

I can't get my head around the more complicated regular expression stuff that would solve my problem - can anyone point me in the right direction?

Cheers!

Upvotes: 0

Views: 112

Answers (1)

Jorge Campos
Jorge Campos

Reputation: 23371

Try this:

Find what:(group[\d]{5})
Replace with: \1\r\n

What I'm saying is:

Find every word group followed by a digit with five characters([\d]{5}) and then replace by all regex group 1 (which is the sentence inside the parenthesis) plus \r\n

Upvotes: 1

Related Questions