I'm relatively new to Notepad++, and am having trouble getting a fairly standard regular expression working.
I'm working in LaTeX, and want to using Find/Replace (either CTRL-H or CTRL-R) to insert some TeX macros into my document.
Eg. I want to put "\abc" at the beginning of each line in the selected text.
Normally (in Perl, PHP, etc) I would just use "\\abc" as the replacement text, so that "\\" (double backslash) would give me a single backslash in the document, followed by abc (the desired result). Notepad++, however, has the annoying habit of grouping the second backslash with the "a", not the first backslash!
The only solution I have found so far is to do it in two steps -- replace with plain "abc" with regular expressions turned on, then replace all "abc"s with "\abc"s with regular expressions turned off.
Surely it is possible in one step?
Thanks,
Simon
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm relatively new to Notepad++, and am having trouble getting a fairly standard regular expression working.
I'm working in LaTeX, and want to using Find/Replace (either CTRL-H or CTRL-R) to insert some TeX macros into my document.
Eg. I want to put "\abc" at the beginning of each line in the selected text.
Normally (in Perl, PHP, etc) I would just use "\\abc" as the replacement text, so that "\\" (double backslash) would give me a single backslash in the document, followed by abc (the desired result). Notepad++, however, has the annoying habit of grouping the second backslash with the "a", not the first backslash!
The only solution I have found so far is to do it in two steps -- replace with plain "abc" with regular expressions turned on, then replace all "abc"s with "\abc"s with regular expressions turned off.
Surely it is possible in one step?
Thanks,
Simon