Dissect any regex into a token-by-token plain-English breakdown
| Token | Meaning |
|---|---|
| ^ | Start of string (or line with /m) |
| (?<scheme> | Named capture group "scheme" — begin |
| h | Literal 'h' |
| t | Literal 't' |
| t | Literal 't' |
| p | Literal 'p' |
| s | Literal 's' |
| ? | Quantifier — 0 or 1 (greedy) |
| ) | Group — end |
| : | Literal ':' |
| \/ | Literal '/' |
| \/ | Literal '/' |
| (?<host> | Named capture group "host" — begin |
| [^/:] | Any character NOT in the set: /: |
| + | Quantifier — 1 or more (greedy) |
| ) | Group — end |
| (?: | Non-capturing group — begin |
| : | Literal ':' |
| (?<port> | Named capture group "port" — begin |
| \d | Any digit (0-9) |
| + | Quantifier — 1 or more (greedy) |
| ) | Group — end |
| ) | Group — end |
| ? | Quantifier — 0 or 1 (greedy) |
| (?<path> | Named capture group "path" — begin |
| \/ | Literal '/' |
| [^?#] | Any character NOT in the set: ?# |
| * | Quantifier — 0 or more (greedy) |
| ) | Group — end |
| ? | Quantifier — 0 or 1 (greedy) |
| (?: | Non-capturing group — begin |
| \? | Literal '?' |
| (?<query> | Named capture group "query" — begin |
| [^#] | Any character NOT in the set: # |
| * | Quantifier — 0 or more (greedy) |
| ) | Group — end |
| ) | Group — end |
| ? | Quantifier — 0 or 1 (greedy) |
| (?: | Non-capturing group — begin |
| # | Literal '#' |
| (?<frag> | Named capture group "frag" — begin |
| . | Any character except newline (unless /s flag) |
| * | Quantifier — 0 or more (greedy) |
| ) | Group — end |
| ) | Group — end |
| ? | Quantifier — 0 or 1 (greedy) |
| $ | End of string (or line with /m) |
Regex is the most-reached-for tool in programming and the hardest to read. This explainer walks through your pattern token by token, naming each anchor, quantifier, group, and character class in English. Pair with the Regex Tester for full understanding: explain → verify → ship.
Regex Tester runs your regex against test strings and shows matches. Regex Explainer dissects the regex itself into human-readable tokens — complementary: use Explainer to understand, Tester to verify.
JavaScript / ECMAScript (RegExp). Features like possessive quantifiers (a++) aren't supported; lookbehind works on modern browsers.
Mostly — the core syntax is shared. Extensions specific to PCRE (e.g. atomic groups (?>)) are flagged as 'unknown' in the breakdown.
Character classes [abc] are summarized as a single token. For finer-grained analysis, split classes and run each character through the tool individually.
Use our Regex Tester for live matching + highlighting; Regex Explainer focuses on explanation.