views:

515

answers:

2

I tried to search for every word that has
bar-foo and switch them to foo-bar
so I wrote on the find (\w+)-(\w+)
and on the replace $2-$1
and instead of writing foo-bar it wrote $2-$1.

Yes, Regular Expression in search mode is on.
It seems that the Replace Regex doesn't work and been taken literally

+5  A: 

With notepad++ you'll need to use \2-\1 as the replacement string.

Sources :
Mark's Speechblog

Colin Hebert
Holy crap! thank you! any other changes?
Asaf
For instance, why when I try to search for (empty|isset) it doesn't find anything although there's 'empty' inside the doc?
Asaf
+2  A: 

Use \2 \1 in the replace field.

Notepad++ uses the linux like \1 syntax instead of $1

Amarghosh