Loading...

Build your own grep

Learn about regex syntax: character classes, quantifiers and more

Start Building
grep
Haskell
grep
Python
grep
Rust
grep
Go
grep
C++
grep
JavaScript
grep
C#
grep
TypeScript

Regular expressions (Regexes, for short) are patterns used to match character combinations in strings. In this challenge you'll build your own implementation of grep, a CLI tool for searching using Regexes.

Along the way you'll learn about Regex syntax, character classes, quantifiers and more.

Stages

Match a literal character
Login via GitHub to view this stage
Match digits
Login via GitHub to view this stage
Match alphanumeric characters
Login via GitHub to view this stage
Positive Character Groups
Login via GitHub to view this stage
Negative Character Groups
Login via GitHub to view this stage
Combining Character Classes
Login via GitHub to view this stage
Start of string anchor
Login via GitHub to view this stage
End of string anchor
Login via GitHub to view this stage
Match one or more times
Login via GitHub to view this stage
Match zero or one times
Login via GitHub to view this stage
Wildcard
Login via GitHub to view this stage
Alternation
Login via GitHub to view this stage

Backreferences

Single Backreference
Login via GitHub to view this stage
Multiple Backreferences
Login via GitHub to view this stage
Nested Backreferences
Login via GitHub to view this stage