in reply to Re^2: Parse::RecDescent: problem with grammar and error reporting
in thread Parse::RecDescent: problem with grammar and error reporting

Ah, it's because if one has /PAT1*PAT2*/ Perl prefers to match as many PAT1s as possible, even to the extend of matching less in total. Witness the difference:
$ perl -wE 'q{Even more test address@test.com @20} =~ /[^@\n]*(?:\S@[^ +@\n]*)*/ and say $&' Even more test address $ perl -wE 'q{Even more test address@test.com @20} =~ /[^@\n]*(?:\S@[^ +@\n]*)+/ and say $&' Even more test address@test.com
Try this:
/[^\S\n]*(?:[^\s@]+@?[^\S\n]*)*/

Replies are listed 'Best First'.
Re^4: Parse::RecDescent: problem with grammar and error reporting
by kikuchiyo (Hermit) on Jan 20, 2012 at 12:44 UTC

    Nice.

    Only problem with it is that it matches the empty line, which it shouldn't do. This way every line ends up on one unterminated slide, so the parsing fails at the end.

      I'm sure you can fix that yourself, don't you think?
        Ahem... yes, thanks.