in reply to parsing from the right instead of the left

I definitely suggest you check out Sex, Eger!, my paper (soon to be at perl.com!) on reversing regular expressions to match the last of something in a string.

If you want to match forward, then you want to match the last sequence of non-. characters in a string. This can be matched by ($ext) = $str =~ /([^.]+)$/.

If you want to reverse it, simply do $ext = scalar reverse( reverse($str) =~ /([^.]+)/).

$_="goto+F.print+chop;\n=yhpaj";F1:eval
  • Comment on RE: parsing from the right instead of the left