Reputation: 27
I have to add specific string each line in Notepad++. How can I do? Thanks!
Before:
I am a boy A.
I am a girl A.
After:
I am a boy A boy.
I am a girl A girl.
Upvotes: 3
Views: 429
Reputation: 91385
After you've checked the regular expression choice:
Find: (\S+)\s(\S+)\.$
replace: $1 $2 $1.
Upvotes: 0
Reputation: 28722
CTRL + H
at search method select
Expandend (\n, \r, \t, \0, \x...)
and with the search fields you select
At search for you enter : \n
At Replace by you enter : My specific string \n
Or use macro's
Upvotes: 0
Reputation: 138017
Open the Replace window and check Regular expression:
Find what: \b(\w+)\.$
Replace with: \1 \1.
\b(\w+)\.$
is a simple regex that matches the last word before the period. The word is captured into the first group (\1
or $1
both work in Notepad++), so it can be used twice while replacing.
Upvotes: 1