I want a substitution with a Perlvar of the nth match, if one exists?
If I understand your question correctly, then no, no such perlvar that keeps track of "how many" regexes have been executed/replaced exists, and you'll have to use one of the other methods you described. Update: Or the clever hack by choroba.
In reply to Re: Perl substitute with the nth match
by haukex
in thread Perl substitute with the nth match
by misterperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |