in reply to Re^2: Matching Regular expression at EOF
in thread Matching Regular expression at EOF

Anchoring at the end of the string only matches if there's an actual match at the end of the string. But the last match doesn't imply it's at the end of the string. For instance, in the string below, there are two matches for /a.b/, on of them the last one, but none for /a.b\z/.
"123 a!b 456 a?b 789"

Replies are listed 'Best First'.
Re^4: Matching Regular expression at EOF
by AnomalousMonk (Archbishop) on Feb 22, 2010 at 21:53 UTC

    In my original persual of the OP, I missed the phrase "last occurence" [sic] and was beguiled by the phrases "Matching ... at EOF" and "match ... at the very end of the input file". Starting from my assumption that the entire file had been slurped into a string, I strayed into a consideration of  \z et al.

    I now recognize my error.