RegEx Tester and Explainer

Test regular expressions, highlight matches, and explain tokens.

🔒 Client · Offline
Processed locally
This tool runs in a Web Worker with a 2-second timeout to protect against catastrophic backtracking.
Engine ECMAScript (this browser)

Use $1 for a numbered group, $<name> for a named group, and $& for the whole match.

Test cases

0 pass 0 fail
Waiting
Waiting

Drop a test case JSON file here to restore a suite.

Matches

2

/\b(?<word>[A-Z][a-z]+)\b/dg

The editor above marks each match. Capture groups get their own color.

  • Match 1 · 0–5 · Hello

    • #1 (word) : Hello · 0–5
  • Match 2 · 20–25 · Space

    • #1 (word) : Space · 20–25

Replacement preview

[Hello] world. KitDev [Space] helps builders ship tools.

Token explanation

  • \bWord boundary.
  • (?<word>Named capturing group "word".
  • [A-Z]Character class. Matches one character from the listed set.
  • [a-z]Character class. Matches one character from the listed set.
  • +Quantifier. Matches the previous item one or more times.
  • )Group end.
  • \bWord boundary.

About the RegEx tester

This tool tests a regular expression against sample text in the browser.

The editor marks each match. Capture groups list names and indices when present.

The engine is the regular expression engine of this browser. Other engines, such as PCRE or Python, can give a different result for the same pattern.

This tool does not store your input.

Modern syntax

Unicode properties \p{…} and \P{…}
Matches one character by a Unicode property. Set the u flag or the v flag. \p{Script=Greek} matches α
Lookbehind (?<=…) and (?<!…)
Tests the text before the current position. The engine does not consume that text. (?<=\$)\d+ matches 42 in $42
Named groups (?<name>…)
Gives a name to a capture group. Read the group back with \k<name> or $<name>. (?<year>\d{4}) captures 2026