Parrot Perl 6 regexes #21

Backtracking control -- tokens

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

For modern one-pass languages, non-backtracking regexes are very common

The keyword "token" indicates a regex that does no backtracking by default

"182745909809283949 minus 4" ~~ token { \d+ ' plus ' \d+ }
continued...
Copyright © 2009
http://www.pmichaud.com/2009/pres/