Reputation: 460
Using Notepad++ and replace function, I tried to add a symbol "+" or "[" before each word of my list.
Example of list :
I'm looking for the following result :
I know how to add a character befor each line... but I cannot find the way to add it in front of every word without using replace "blue" to "+blue".
Upvotes: 4
Views: 26413
Reputation: 626748
A cross platform solution should be
Search: \b\w+\b
(or \b[[:alpha:]]+\b
)
Replace: +$&
Search pattern details:
\b
- a leading word boundary\w+
- 1 or more word chars (if [[:alpha:]]+
is used, 1+ letters)\b
- a trailing word boundaryReplacement details: +
is a literal plus, and $&
is the backreference to the whole match.
See the screenshot:
Upvotes: 10
Reputation: 2542
(see screenshot below)
Ctrt
+H
)Find
input, enter this regex: (\b\w)
which means "word boundary followed by a letter"Replace with
input, enter this replacement: +\1
which means "put a +
sign followed by whatever was matched between the regex parenthesis"Show advanced options
checkboxSearch with regular expressions
radio buttonReplace
button as many times as you want, or use Replace all
for onceEDIT: for Windows is pretty much the same (see the find/replace dialog http://sqlblog.com/blogs/jamie_thomson/image_1AFC2B61.png) the Regular Expression option is at the bottom left
Upvotes: 2