$string, $from, and $to can be pretty much any length you want.my $string = "abababa"; my $from = 'b'; my $to = 'x'; print "was [$string]\n"; substr($string, rindex($string, $from), length($from)) = $to; print "now [$string]\n";
In reply to Re: RE - match from right
by TedPride
in thread RE - match from right
by bangers
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |