in reply to Get last occurence of a character in a string
ors/.*\\(?=[^\\]$)//;
will work (assuming that you have a copy of the string of interest in $_, and don't mind that copy being overwritten).reverse; $_ = reverse substr($_, 0, index($_, '\\'));
UPDATE: Oops, the rindex function, mentioned at Re: Index of the last occurence of a character inside a string, is much better than this reverse-based solution.
|
|---|