Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
to replace all instances of non-escaped variable names in a source file with the output of whatever(). would there be any way to extend this pattern to NOT match $something[x] (so a scalar name followed by an array subscript, as that actually refers to an array, not a variable)..so basically look at ahead or something and ignore the pattern if its followed by a '['. thx.s/(?<!\\)(\$[a-zA-Z0-9_]+)/whatever()/ge;
Edit: chipmunk 2001-04-26
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: problem with substitution regex
by MrNobo1024 (Hermit) on Apr 27, 2001 at 03:12 UTC | |
|
Re: problem with substitution regex
by hdp (Beadle) on Apr 27, 2001 at 03:29 UTC | |
by MeowChow (Vicar) on Apr 27, 2001 at 03:41 UTC | |
by hdp (Beadle) on Apr 27, 2001 at 03:42 UTC |