develooper Front page | perl.perl6.language | Postings from May 2005

Re: C<::> in rules

Thread Previous | Thread Next
From:
Luke Palmer
Date:
May 13, 2005 08:36
Subject:
Re: C<::> in rules
Message ID:
7ca3f01605051308363c08895@mail.gmail.com
On 5/13/05, Patrick R. Michaud <pmichaud@pobox.com> wrote:
> To use the phrase from later in your message, there's still
> the "implicit .*? followed by the rule call."  Since the rule
> itself hasn't failed (only the group failed), we're still free to
> try to match the pattern at later positions.

I'm basically saying that you should treat your:

    $str ~~ /abc :: def | ghi :: jkl | mn :: op/;

As:

    $rule = rx/abc :: def | ghi :: jkl | mn :: op/;
    $str ~~ /^ .*? <$rule>/;

Which means that you fail the rule, your .*? advances to the next
character and tries the rule again.

Maybe I'm misunderstanding your interpretation (when in doubt, explain
with code).

Luke

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About