Course of Raku / Regexes and grammars / Grammars / Tokens and rules / regex, token, and rule
Quiz — Backtracking
Which of the three keywords declares a named pattern that backtracks, like the patterns written between slashes?
| 1 | regex |
| 0 | token |
| 0 | rule |
| 0 | none of them |
A regex backtracks. Both token and
rule are ratcheting — they do not give back characters once
matched — which is why they are the right default inside grammars.