Course of Raku / Regexes and grammars / Regexes / Captures / Exercises
Initial and surname
Problem
The string 'J Smith' is an initial (a single letter), a
space, and a surname. Using named captures called
initial and surname, match the string and
print the surname.
Example
The program prints:
SmithSolution
Course navigation
← Solution: Last name first | Solution: Initial and surname →