I need some help. I'm trying to replace multiple keywords in notepad++. See example below:
Find all:
apple alpha anchor ants all am are
Replace with:
"apple" "alpha" "anchor" "ants" "all" "am" "are"
Is there a way to replace it in one go?
I need some help. I'm trying to replace multiple keywords in notepad++. See example below:
Find all:
apple alpha anchor ants all am are
Replace with:
"apple" "alpha" "anchor" "ants" "all" "am" "are"
Is there a way to replace it in one go?
Press Hotkey: Ctrl + H (Replace)
tab: Replace
Find what: ((\b[^\s]+\b)((?<=\.\w).)?)
Replace with: "$1"
Select searchmode: Regular expression
Replace all => DONE
UPDATE
((\b[^\s]+\b)((?<=\.\w).)?)
Regular expression, you can find more information in Wiki, some good tutorial is here and here: this regex will select all "word" seperate by space
or .
"$1"
you can find more information about this symbol here, mean we replace each word with ""
and put the selected word it the middle
\w+
"$0"
Explanation:
\w+ # 1 or more word character (i.e. [a-zA-Z0-9_])
you could use [a-z]+ instead of \w+ if you want only lowercases
or \S+ if you want to match any character that is not a space
Replacement:
" # a double quote
$0 # content of group 0, the whole match (i.e. the keyword)
" # a double quote
Result for given example:
"apple" "alpha" "anchor" "ants" "all" "am" "are"