Course of Raku / Regexes and grammars / Grammars / Tokens and rules / Significant space in rules

Quiz — Tokens and rules

Which keyword should you use for a named pattern that must match whitespace between its parts, the way it is written in the pattern?

0regex
0token
1rule
0grammar

A rule is a token with significant whitespace turned on, so the spaces written between its parts must appear in the input. A plain token ignores those spaces, and regex does too (while also backtracking).

Course navigation

Significant space in rules   |   Regex versus token