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

Re: C<::> in rules

Thread Previous | Thread Next
Luke Palmer
May 13, 2005 08:36
Re: C<::> in rules
Message ID:
On 5/13/05, Patrick R. Michaud <> 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/;


    $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).


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About