Regex Tester & Plain-English Explainer

Write a pattern and test string — matches highlight as you type. Inspect capture groups, switch to replace or split, and read a plain-English breakdown of every token. Nothing leaves your browser.

/ /{{flags}}
✕ {{error}}
✕ Live testing needs Web Workers, which aren't available right now (or failed to load). Matching, replace and split stay off rather than risk freezing the page.
Enter a pattern to begin. Test string is over {{MAX_INPUT_CHARS.toLocaleString()}} characters — shorten it to run live matching. ⚠ Took too long against this input — likely catastrophic backtracking. Try a narrower pattern. ⏳ Running… ✓ Valid — {{workerMatches.length}} match{{workerMatches.length===1?'':'es'}}

The link will also carry your {{text.length}}-character test string — anyone with the link can read it.

Test string

{{ num }}

Test cases {{passingCaseCount}}/{{testCases.length}} passing

Save example strings the pattern should — or should not — match, so a later edit can't silently break them.

{{tc.pending ? '…' : (tc.pass ? '✓' : '✕')}} {{tc.text}} {{tc.shouldMatch ? 'should match' : 'should NOT match'}}

Result

Explanation

A valid pattern is explained token by token here.

{{grp.h}}

{{r[0]}}{{r[1]}}

About this tool

Uses your browser's native RegExp engine, so matches, replace and split behave exactly like they would in JavaScript — the explainer just walks the pattern token by token and describes each one in plain English. Matching, replace and split run in a background Web Worker with a time limit, so a runaway pattern (catastrophic backtracking) can't freeze the page.

Test cases save example strings the pattern should or shouldn't match — including expected capture groups for positive cases — and stay saved in this browser so a later edit can't silently break them. Saved patterns work the same way for the pattern itself. Both are stored only in this browser's local storage, never uploaded.

Share builds a link with just the pattern and flags by default. Including the test string is a separate, explicit checkbox with a preview of what that adds — it's off by default since pasted test text can contain data you didn't mean to put in a URL.

Everything runs locally as you type. Your pattern and test string are never sent anywhere on their own — only if you build a share link yourself and send it, and then only with the test string if you explicitly opted that in.