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
In reply to Re: Simple way to split on last match?
by johngg
in thread Simple way to split on last match?
by aturtle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |