in reply to RE: RE: RE: Selective substitution: not in Perl?
in thread Selective substitution: not in Perl?
You're absolutely right, of course. Now I remember why I didn't post that solution in the first place :(
Update:
On thinking about it further, I realise that:
$string =~ s/^(($pattern.*?){$n})$pattern/$1$better/;
will probably do the trick.
--
|
|---|