in reply to Substitute script for a newbie
UPDATE, I reaped this against social norm. I had mentioned that I like extended regexes (/x) so that I can comment them. E.g.
m/^A.TL5 ([EF]) # my match here 00/x
I like this because later the comment will help me to remember what I was doing, and in general regexes can be hard to read. I mistakenly extended this to to s///.
Toolic pointed out that extended regexes in s/// only work on the matching part, not the replacing part. So this, I hope, is the legal one:s/^A.TL5 ([EF]) # my match here 00 / NEW \s+ {$1} # replae here /x
s/^A.TL5 ([EF]) # my match here 00 /NEW {$1}/x
Neil Watson
watson-wilson.ca
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Substitute script for a newbie
by toolic (Bishop) on Jul 14, 2015 at 18:05 UTC | |
|
Re^2: Substitute script for a newbie
by Laurent_R (Canon) on Jul 14, 2015 at 18:49 UTC | |
|
Re^2: Substitute script for a newbie
by Laurent_R (Canon) on Jul 14, 2015 at 20:16 UTC |