Extra practice

Regex Exercises

Use the exercises below as free practice. Try solving them in the playground and then compare with the explanation.

Beginner

Numbers only

Create a regex that matches 12345 and rejects A123 and 12-34.

Beginner

Code prefix

Find codes that start with DEV- and end with four digits.

Intermediate

Dates

Match only the format DD/MM/AAAA.

Intermediate

Files

Find file names ending in .jpg, .jpeg or .png.

Want automatic validation?

The 20 game levels already include positive and negative cases, score, XP, and progressive hints.

Solve levels