Regexdrill

Level 1: Basics Exercise 4 of 52 Free

Ranges: a letter and two digits

A regex exercise from Regexdrill. Solve it with a pattern box with live highlighting in your browser, checked against hidden test strings, and it is checked the moment you submit.

The task

The whole line must match. Match one lowercase letter followed by exactly two digits, like a12.

What this exercise teaches

[a-z][0-9][0-9] (or [a-z]\d{2}) takes one lowercase letter and then two digits. Uppercase letters fall outside a-z.

A hint if you get stuck

Inside brackets, a hyphen between two characters means a range, such as a-z or 0-9.

Try it now, no account needed

This exercise is free. Open it on the practice page, solve it, and get instant feedback with a hint and a worked solution after two tries.

Open this exercise

More exercises in Basics