Skip to content
ErgaLab
Regex

Regex Explainer

Paste any regular expression and see it broken into individual tokens — character classes, quantifiers, anchors, and groups — each explained in plain English.

Pattern

//

Token-by-token breakdown

  • ^start of the string (or line, with the m flag)
  • \d{3}any digit (0-9), repeated exactly 3 times
  • -a literal "-"
  • \d{4}any digit (0-9), repeated exactly 4 times
  • $end of the string (or line, with the m flag)

How it works

Regular expressions pack a lot of meaning into very few characters, which makes them fast to write but hard to read later — especially someone else's. This tool walks through your pattern left to right and labels each piece: what a character class like [a-z] matches, what a quantifier like {3,5} means, and what role each group or anchor plays.

Want to test the pattern against real text instead? Use the Regex Tester. Need to build one from scratch? Try the Regex Generator.

Examples

US phone-style pattern

Anchors, digit classes, and quantifiers.

^\d{3}-\d{4}$

Simple email shape

Character classes and a literal.

[a-z]+@\w+\.com

Optional group

A group made optional with ?.

colou?r

Frequently asked questions