Please disregard. I misread the OPs question. This code does the opposite.
my $file = 'c:\folder1\filename.doc'; $file =~ s{ # Substitue... \\ # a backslash [^\\]* # zero or more not-backslashes $ # at the end of string } {}x; # with nothing # allow comments & spaces in search-pattern print $file; # c:\folder1
In reply to Re: Get last occurence of a character in a string
by FunkyMonk
in thread Get last occurence of a character in a string
by theroninwins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |