in reply to Re^4: Regex: Capturing and optionally replacing
in thread Regex: Capturing and optionally replacing
Substitutions work by editing the string being matched, but you want the substitutions to work on the string being returned. That doesn't work.
You could do it with a parser, but Perl 5 regexp are not good enough to form a parser. (Well, it's theoretically possible with experimental regexp features.)
|
|---|