Too Much Tools logoToo Much Tools

Regex Tester

Test JavaScript regular expressions against sample text with live matches, groups and replace.

Local, Runs entirely in your browser, your data never leaves your device.
Loading tool…

Test a pattern against real text as you type

Writing a regular expression usually means editing a pattern, running it, and re-reading the input over and over until the matches look right. This tool keeps the pattern, flags and test string on one screen and re-runs the match on every keystroke, highlighting each match inline and listing its capture groups. People often paste log lines, API responses or tokens in here to build an extraction pattern, and because matching runs locally in the JavaScript engine, that text never leaves the tab.

How to use the Regex Tester

  1. Type a pattern into the /pattern/ field and toggle flags: g, i, m, s and u.
  2. Paste or edit the test string in the Test string box below the pattern.
  3. Read matches highlighted inline in the Match preview panel as you adjust the pattern.
  4. Switch to the Replace tab to preview a substitution using $1 or $<name> group references.
  5. Open the Details tab for per-match capture groups, or Explain for a token-by-token breakdown of the pattern.

Matching uses JavaScript's native RegExp engine, which is close to but not identical to PCRE or .NET regex. Selecting ".NET (approx)" only rewrites a handful of constructs, like (?'name'…) groups and \A/\Z anchors, it does not add full .NET compatibility.

A global match run stops after 10,000 matches as a guardrail against a pattern that matches empty strings in a runaway loop, which is more than enough for realistic log or text samples.

Frequently asked questions

Does this support PCRE or Python regex syntax?
Not directly. It runs JavaScript's built-in RegExp engine, so PCRE-only features like atomic groups or possessive quantifiers, and Python-only inline flags, will either error or silently behave differently than you expect.
Is my test text uploaded anywhere?
No. Matching runs in your browser's JavaScript engine against the RegExp object, so pasted log lines, tokens or sample payloads are never sent to a server, which matters if the text includes anything sensitive.
Can I test a .NET-style regex here?
Choose ".NET (approx)" from the engine dropdown, which rewrites a few common .NET-only patterns like named groups and start/end anchors into JavaScript equivalents, but the underlying matcher is still the JS engine, not .NET's.
How do I see what my pattern actually matches, piece by piece?
Open the Explain tab, which walks the pattern token by token, labeling each escape, character class, group, quantifier and anchor in plain language, without running it against any text.
Why does my capture group show as empty?
An optional group that didn't participate in a given match reports as an empty string in the Details tab rather than undefined, which is how the tool renders a group that matched zero characters or was skipped by alternation.