Simple rules
Here's a Perl 6 regex to parse simple addition/subtraction statements
\d+ [ '+' | '-' ] \d+
Some differences between Perl 5 and Perl 6 regexes
- All non-alphanumeric characters are metasyntactic (non-literal match)
- Literals can be specified using quotes
- Whitespace is metasyntactic
- Square brackets are now non-capturing groups