Regex Tester, Pattern Library & Explainer
Test a JavaScript-compatible regex against sample text, see matches live, and get a plain-English breakdown of what each part of the pattern means.
How to use it
Enter your regex (optionally with flags in /pattern/flags form), type the test text, and click Run Test. All matches and capture groups are listed below. Click Explain Pattern for a token-by-token, plain-English breakdown of what the regex does.
Frequently Asked Questions
Which regex engine is used?
Your browser's built-in JavaScript (ECMAScript) regex engine — that's the only engine that can actually execute inside a web page. We don't offer a PCRE/Python/Java "flavor" switch, because without a real engine for each behind it, that would just be a label with no actual behavior change. Differences from ECMAScript are usually minor (e.g. possessive quantifiers and atomic groups aren't supported here).
How do I add flags?
Wrap your regex in slashes like /pattern/gi and the trailing letters are read as flags (g: global, i: case-insensitive, m: multiline, s: dotall).
How does the pattern explainer work?
It walks through your regex token by token — anchors, character classes, quantifiers, groups, escapes — and describes each one in plain English. It's a best-effort breakdown, not a formal parser, so unusual or deeply nested patterns may not be described perfectly.