in reply to Quick regex substitution question
use warnings; use strict; my $string = "I have multiple ; in my string; however I want to keep t +he last one;"; my $count = $string =~ tr/;//; $string =~ s/;// for 1 .. $count-1; print "$string\n"; __END__ I have multiple in my string however I want to keep the last one;
|
|---|