Course of Raku / Regexes and grammars / Regexes / Alternations / Exercises / A size word
Solution: A size word
Here is a possible solution to the task.
Code
say 'a large pizza' ~~ / small | medium | large /;🦋 You can find the source code in the file colour-word.raku.
Output
「large」Comments
The alternation lists three possibilities; the pattern matches whichever one is present in the string.
Only
largeappears, so that is the match.
Course navigation
← A size word | http or https →