Loading...

Build your own grep

Learn about regex syntax: character classes, quantifiers and more

Regular expressions (Regexes, for short) are patterns used to match character combinations in strings. grep is a CLI tool for searching using Regexes.

In this challenge you'll build your own implementation of grep. Along the way we'll learn about Regex syntax and how Regexes are evaluated.

Stages

Match a literal character

In this stage, we'll handle the simplest regex possible: a single character.

Example:

a should match "apple", but not "dog".

Very easy
We'd expect a proficient developer to take < 5 minutes to complete this stage.
Match digits

In this stage, we'll implement support for the \d character class.

\d matches any digit.

Example:

\d should match "1", but not "a".

Very easy
We'd expect a proficient developer to take < 5 minutes to complete this stage.
show all...