How do C<&> and C<&&> differ with respect to backtracking?  For instance,

    "foobar" ~~ / <[a..z]>+ & [ ... ] /;

Both sides of the C<&> happen in parallel, so I would guess that they
both match "foo" then stop. Please correct me if that's wrong.

Were we using the procedural conjunction:

    "foobar" ~~ / <[a..z]>+ && [ ... ] /;

I would guess that the LHS matches as much as it can ("foobar"), then
the RHS matches "foo". Since "foobar" ne "foo", the regex engine
backtracks on the LHS matching "fooba" and then the RHS matches "foo"
again. Again, since "fooba" ne "foo", the regex engine backtracks as
before and this behavior continues until both sides match "foo" (or, in
the general case, it can determine that the conjunctions can't match the
same portion of the string)

Or it's much simpler than that and both of the regexes above just fail
because of the greediness of C<+> and there is no intra-conjunction
backtracking.

So ... anyone care to enlighten me on how this is supposed to work?

Thanks,

-Scott
-- 
Jonathan Scott Duff
[EMAIL PROTECTED]

Reply via email to