Course of Raku / Addendum 🆕 / Types and text machines

Regexes and grammars

Recognising and pulling apart text: matching with regexes and captures, substitution, and small grammars — including one that computes a result through an action class.

Exercises

This section contains 6 exercises. Examine all the topics of this section before doing the coding practice.

  1. Extract and sum numbers
  2. Parse a date with named captures
  3. Normalise whitespace
  4. Validate identifiers
  5. A grammar for full names
  6. A grammar that adds

Course navigation

Solution: Animals that speak   |   Extract and sum numbers