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

Two to four

Problem

Using the ** quantifier with a range, write a pattern that matches between two and four word characters. Test it on 'abcdef' and print the match.

Example

The program prints:

「abcd」

Solution

See the solution

Course navigation

Solution: A frugal match   |   Solution: Two to four