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;
In reply to Re: Quick regex substitution question
by toolic
in thread Quick regex substitution question
by jmmach80
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |