Course of Raku / Regexes and grammars / Regexes / Literals and character classes / Exercises / A vowel
Solution: A vowel
Here is a possible solution to the task.
Code
say 'Hello' ~~ / <[aeiou]> /;🦋 You can find the source code in the file a-vowel.raku.
Output
「e」Comments
The class
<[aeiou]>lists the five vowels; it matches whichever one appears first.In
Hello, the letterHis not in the class, so the match starts ate.
Course navigation
← A vowel | The first non-digit →