kr123 has asked for the wisdom of the Perl Monks concerning the following question:
I'm attempted to substitute and replace some text, but the text in my substitution is interfereing with my \1 variable. Does anyone know of some sort of a NULL character I can place between my \1 variable and the surrounding text?
For example, I am using the statement:
s/(some) text/\155/
I want the new string to read:
some55
But what I assume is happening is Perl tries to find match 155 rather then match 1.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: In substituation regex, how to differentiate \1 from surrounding text
by merlyn (Sage) on May 19, 2004 at 20:53 UTC | |
by Roy Johnson (Monsignor) on May 19, 2004 at 21:30 UTC | |
|
Re: In substitution regex, how to differentiate \1 from surrounding text
by Enlil (Parson) on May 19, 2004 at 21:07 UTC |