views:

68

answers:

3

Hi guys,

simple example in Notepad++ using RegEx replace
search for: anything
replace with (wanted): \test

  1. guess for regex replace string: \test
    results in: tabest, so the \t is interpreted as a tab

  2. guess for regex replace string: \\test
    results in: \ tabest, so the first \ is interpreted as a \, the \t is interpreted as a tab

  3. guess for regex replace string: \ test (spacein between \ and test)
    results in: \ test (spacein between \ and test)

How can I do this to get \test as the result? Are there any group or end of command characters for the replace string? Or an empty character that I can add after the \?

Thanks, Axel

+1  A: 

How about replacing with \\test? Usually \ must be escaped with \.

Thorsten Dittmar
Sorry, didn't format my question correctly. Changed it now. Of course I tried that, result as now seen above.
Axel
Ok, just tried it myself in Notepad++ - works in extended mode, but not with regular expressions. weird...
Thorsten Dittmar
It doesn't seem to work with \r and \n either. My guess - as Jens said - would be that this is a bug in Notepad++.
Thorsten Dittmar
A: 

Try 3 backslashes, this kind of thing often works in other tools/languages.

Peter Kruithof
No, this doesn't work either. Only adds one more backslash.
Thorsten Dittmar
+1  A: 

This seems to be an open issue with notepad++.

Jens
thank you, that is a good link! I hope it'll be solved soon.
Axel