Parrot Perl 6 regexes #20

Backtracking control -- tokens

Consider:

"182745909809283949 minus 4" ~~ / \d+ ' plus ' \d+ /

Backtracking the first \d+ can be very inefficient

In Perl 5, we would write something like

/ (?>\d+) plus (?>\d+) /x
continued...
Copyright © 2009
http://www.pmichaud.com/2009/pres/