in reply to Simple way to split on last match?
Another way to do it, since your delimiter is invariate, would be to use substr and rindex.
[johngg@justy Documents]$ perl -E ' > $str = q{last -- From --00--SPLIT ?--11452}; > $delim = q{--}; > $last = substr $str, rindex( $str, $delim ) + length $delim; > say $last;' 11452 [johngg@justy Documents]$
I hope this is helpful.
Cheers,
JohnGG
|
|---|