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+) /xcontinued...
Parrot | Perl 6 regexes | #20 |
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+) /xcontinued...
Copyright © 2009 http://www.pmichaud.com/2009/pres/ |