2011
10-13

notepad++ regex replace

Notepad++ is great free text editor.
You can download it at http://notepad-plus-plus.org/.
It have regex replace option.
So how it work ?
Here is example.
lets say we have text:
akljdjfalkjdf
Alice1 have cat2.
jakdhfkljakljdf
Alice2 have cat3.
Alice5 have cat8.
akljdflkja
Alice123 have cat7.
Now lets make some advenced search and replace.
Go to Search - Replace.
And to it like that
Search for: Alice([0-9]+) have cat([0-9]+)
Replace with: a\1 have c\2
And be sure that you have checked Search Mode - Regural expression.
Press Replace All
And we have
akljdjfalkjdf
a1 have c2.
jakdhfkljakljdf
a2 have c3.
a5 have c8.
akljdflkja
a123 have c7.
I hope it will be hopeful for you.
No Coments jet.

Leave a Reply

  ( Ctrl+Enter )