Parrot Perl 6 regexes #23

Rules

The 'rule' keyword says that whitespace in the regex corresponds to whitespace in the input

rule { \d+ plus \d+ }

is the same as

token { <.ws> \d+ <.ws> plus <.ws> \d+ }

The default <.ws> makes this act something like

token { \s* \d+ \s+ plus \s+ \d+ \s* }
Copyright © 2009
http://www.pmichaud.com/2009/pres/