Course of Raku / Regexes and grammars / Regexes / Alternations / Exercises

A size word

Problem

Write a pattern that matches any of the three size words small, medium, or large. Test it on 'a large pizza' and print the match.

Example

The program prints:

「large」

Solution

See the solution

Course navigation

Solution: Word or digit   |   Solution: A size word