>_ IzzyLab

Topic breakdown

This task teaches the difference between character-by-character and greedy matching. The digit class [0-9] by itself matches a single digit, so the number 42 would break into two separate matches — the "one or more" quantifier (+) makes the engine grab consecutive digits as a single whole until a non-digit character appears. grep's "print only the matched piece" mode outputs each match on its own line, which is what's required. The shorthand \d is a PCRE extension and requires a different flag than extended regex.

What's checked

  1. All numbers extracted

What it looks like