Reputation: 35
I would like to find all lines that follow this format:
type="file_one_id"
type="file_two_id"
type="file_three_id"
And replace them with a single replacement line:
type="my_generic_replacement"
The problem is that there are many other lines which also start with type="file_
or end with _id"
, so I'm thinking that searching for lines that both begin with type="file_
and end with _id"
will be required. Is there a way to do this with notepad++?
Upvotes: 2
Views: 4300
Reputation: 25
You can find and replace \r\n and tick Extended in the Replace box; \r\n matches carriage-return + line-feed. Some systems may only have \r or only \n at the line breaks
Upvotes: 0
Reputation: 4887
To replace the lines in Notepad++ you can use this regex:
type="file_\w+_id"
To open the window click Search => Replace
Upvotes: 1
Reputation: 8413
You could search for ^type="file_.*_id"$
(using Regular Expressions) and replace with type="my_generic_replacement"
Upvotes: 5