Update: ... or non-greedy from the other end:my $txt = "This_has_under_scores.mp3"; $txt =~ s/(.+)_/$1/; print $txt; # "This_has_underscores.mp3";
$text =~ s/_(.*?)$/$1/;
In reply to Re: Removing underscores.
by davidrw
in thread Removing underscores.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |