I'm making a global change to my source file. I have a macro to make the changes, however I'd like to attempt using a regular expressions. I'm having issues with the syntax, however.
I want to simply replace all my functions with the exact same line followed by an added subroutine.
original:
---
function xyz
---
replaced with:
---
function xyz
statistics_routine
---
I can match the function and linefeed alright, but the first group match (\1) simply returns the exact string -- "\1" rather than the match. I did switch to POSIX format, but that didn't help.
My fields are
find:
^function.*\n
replace:
\1\nstatistics_routine
Thanks in advance,
dgp
Greedy Group problem
Moderators: AmigoJack, bbadmin, helios, MudGuard
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
orFind what: ^function.*
Replace with: \0\nstatistics_routine
[X] Regular expression
Replace All
or similar.Find what: ^(function.*)
Replace with: \1\nstatistics_routine
[X] Regular expression
Replace All
The second of these assumes you are using "Posix" regular expression syntax:
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax