Regex Explainer
Turn a cryptic regular expression into a plain-English, token-by-token breakdown with a live match preview.
Pattern
Explanation
^the start of the string (or line in multiline mode)(?<year>start of a named capturing group "year"\dany digit (0-9){4}the preceding token, repeated exactly 4 time(s))end of the group-the literal character "-"(start of a capturing group\dany digit (0-9){2}the preceding token, repeated exactly 2 time(s))end of the group-the literal character "-"(start of a capturing group\dany digit (0-9){2}the preceding token, repeated exactly 2 time(s))end of the group$the end of the string (or line in multiline mode)
Live match preview
0 matches found
About this tool
Reading a dense regular expression is often harder than writing one — a pattern like ^(?<year>\d{4})-(\d{2})-(\d{2})$ hides its meaning behind terse metacharacters. This explainer walks the pattern token by token and describes each piece in plain English, so you can understand exactly what a regex matches without running it in your head.
It parses anchors, character classes and their ranges, shorthand classes like \d and \w, capturing/non-capturing/named groups, lookahead and lookbehind assertions, alternation, and quantifiers including lazy variants. Alongside the explanation, a live match preview runs your pattern against sample text and highlights every match and capture group, and a library of common patterns (email, URL, IPv4, hex colour, ISO date, slug and more) gives you a vetted starting point. Everything is parsed and matched locally with the browser's own RegExp engine.
How to use
Paste a pattern
Enter a regular expression, with or without the surrounding slashes and flags.
Read the breakdown
Each token is listed with a plain-English description of what it matches.
Test against sample text
Type test text to see every match highlighted and the first match's capture groups.
Start from a common pattern
Insert a vetted pattern from the library, read its explanation, then adapt it.
What it explains
| Construct | Example |
|---|---|
| Anchors | ^ start, $ end, \b word boundary |
| Shorthand classes | \d digit, \w word char, \s whitespace |
| Character classes | [a-z0-9], [^abc] (negated) |
| Groups | (...), (?:...), (?<name>...) |
| Assertions | (?=...), (?!...), (?<=...), (?<!...) |
| Quantifiers | *, +, ?, {n,m}, and lazy variants (*?) |
Parsing and matching run in your browser via the native RegExp engine.
Frequently asked questions
Related tools
Subnet Calculator
Calculate IPv4 and IPv6 subnets from CIDR notation — network address, broadcast, usable host range, subnet mask, wildcard mask, and a visual bit map
Programmer Calculator
Multi-base calculator with simultaneous binary, octal, decimal and hex views, bitwise AND/OR/XOR/NOT/shift operations, and IEEE 754 float inspection
Database Connection String Builder
Build and URL-encode connection strings for PostgreSQL, MySQL, MongoDB, Redis and SQLite from a simple form — with JDBC and key/value variants
Docker Compose Builder
Build a valid docker-compose.yml from a visual form — services, images, ports, volumes, environment variables, restart policies and dependencies
NGINX Config Builder
Generate an NGINX server config from a visual form — reverse proxy, static hosting, SPA fallback, SSL termination and HTTP-to-HTTPS redirects