Regex Tester
Test, highlight, and learn regular expressions.
Runs entirely in your browser — nothing you enter is uploaded or sent to a server.
Patterns run on your browser's JavaScript regex engine, so they behave as they do in JavaScript — other flavours (PCRE, Python, Go) differ in places, so test in your target language before you rely on one. Read our full disclaimer.
About this tool
A regex playground built for both getting work done and learning. Type a pattern and sample text and it highlights every match live, lists the capture groups, and — crucially — explains your pattern in plain English, token by token. A built-in cheat sheet covers the common symbols with meanings and examples, so you can practise and understand what each piece does. Toggle the i, m, and s flags as needed. It runs on your browser's native regular-expression engine.
Try it
The pattern (\w+)@(\w[\w.]*\.\w+) finds emails and captures the name and domain as groups. The breakdown explains each symbol; the cheat sheet shows more.
How to use
- 1Type your regular expression in the pattern box.
- 2Toggle flags (ignore case, multiline, dotall) — global is always on.
- 3Enter or paste the text to test against and see matches highlighted.
- 4Read the plain-English breakdown of your pattern, and open the cheat sheet to learn more.
Features
- Live match highlighting with a capture-group breakdown.
- Plain-English explanation of your pattern, token by token.
- A learn-by-example cheat sheet of common symbols.
- Toggle the i, m, and s flags (global is always on).
Frequently asked questions
Which regex flavour does it use?
JavaScript's built-in regular expression engine, running in your browser. Patterns behave exactly as they would in JavaScript.
Is the global flag always on?
Yes — the tester finds all matches, so it always uses the global flag. You can additionally toggle ignore-case (i), multiline (m), and dotall (s).
How do I test a regex against my text?
Type your pattern in the pattern box and paste your text below; every match is highlighted live and the capture groups are listed. Toggle the i/m/s flags as needed — the global flag is always on, so you see all matches, not just the first.
Why does my regex work here but not in Python or PHP?
This uses JavaScript's regex engine. Other flavours — PCRE in PHP, Python's re, Go — differ on things like lookbehind, named groups, and Unicode handling, so always test a pattern in your target language before relying on it.
Can it explain any pattern?
It breaks down the common metacharacters, quantifiers, groups, and character classes in plain English. It's a learning aid, so extremely exotic constructs may be labelled generically.
More developer tools
View allJSON Formatter
Paste raw JSON and get it neatly indented, minified, or validated — entirely in your browser, with a clear error message pointing to anything invalid.
Open toolText Diff
Compare two blocks of text line by line and see exactly what was added, removed, or left unchanged — a quick side-by-side diff that runs in your browser.
Open toolQR Code Generator
Generate a QR code for any text or URL and download it as a sharp SVG or PNG — encoded entirely in your browser, nothing uploaded.
Open tool