Course of Raku / Addendum 🆕 / Types and text machines / Regexes and grammars / Exercises

A grammar for full names

Problem

Write a small grammar that parses a full name — a first and last name separated by spaces — and use it to pull the two parts out of Grace Hopper.

Example

The program prints:

Grace
Hopper

Solution

See the solution

Course navigation

Solution: Validate identifiers   |   Solution: A grammar for full names