~/projects/regex-cheatsheet

The Regex Cheatsheet

A field guide to regular expressions, with a live tester to try every pattern.

Built for every programmer who forgets the syntax

  • Regex
  • Reference
  • Live tester
  • Single page

The problem

Everyone uses regular expressions, and almost nobody remembers the syntax. Most cheat sheets are either a wall of symbols or an ad-covered page.

What I built

A cheat sheet that reads like a printed field guide:

  • Nine chapters: character classes, quantifiers, anchors, groups, escapes, flags, lookarounds, common recipes, and the Laboratory
  • Every entry has a pattern, a plain-English explanation and an example with the match highlighted
  • Ten ready-made recipes, from email addresses to Markdown links
  • The Laboratory: type a pattern and some text and see every match, capture groups included, as you type

It led to The Regex Field Guide, the step-by-step version with exercises.

How it runs

One HTML file, no framework and no build step. The tester runs on your browser's own regex engine.

Next project: Birds Near Me

Get the next write-up by email

New posts and project write-ups, a few times a year. Unsubscribing takes one click.