Regex Tester
Test JavaScript regex live — see every match, capture group, and named group highlighted as you type.
Privacy: your files never leave your device. All processing happens locally in your browser.
How to use
- 1.Type or paste a regular expression into the /…/ field — no need to add the slashes yourself.
- 2.Toggle the g, i, m, s, u, or y flags to control how the pattern is applied (g finds all matches, i ignores case, and so on).
- 3.Enter or paste your test string and read the highlighted matches, capture groups, and named groups in the results below.
About Regex Tester
Regex Tester lets you build, test, and debug regular expressions against your own sample text and see the results the moment you type — no compiling, no server round-trips, no sign-up. It uses the exact same engine your code will run against: the browser's native JavaScript RegExp, so what matches here is what matches in your app.
Type a pattern in the /…/ box and toggle any of the six JavaScript flags: g (global — find every match instead of just the first), i (ignore case), m (multiline — makes ^ and $ anchor to each line), s (dotAll — lets . match line breaks), u (full Unicode handling), and y (sticky — match only from the last position). The flag row shows exactly which flags are active and rebuilds the /pattern/flags literal for you.
Every match is highlighted inline in your test string, and a details panel breaks each one down: its start index, the full matched text, every numbered capture group, and any named groups written with (?<name>…). Groups that didn't participate in a match are clearly marked, which makes it fast to spot why an optional group came back empty.
The tool handles the tricky cases people hit in real work. Zero-width patterns like a*, ^, \b, or an empty pattern match at positions rather than characters; a naive global loop over them freezes the browser, so this tester advances safely past every zero-width match and reports each position without hanging.
Common uses: validating emails, phone numbers, URLs, and slugs; extracting fields like dates, IDs, or prices from logs and scraped text; and prototyping find-and-replace patterns before dropping them into JavaScript, TypeScript, Node, or a build script. Because it mirrors the ECMAScript regex dialect, patterns you confirm here work in String.match, matchAll, replace, and the RegExp constructor without surprises.
A note on performance: a poorly written pattern can trigger catastrophic backtracking (a form of ReDoS) on certain inputs. Here that only ever slows down your own browser tab — nothing runs on a server and nothing is shared — but it's a useful reminder to keep patterns anchored and avoid nested quantifiers on untrusted input in production.
If you're still learning, the tester is a fast way to build intuition for the building blocks: character classes like \d, \w, and \s and their negations; quantifiers such as *, +, ?, and {n,m}; anchors ^ and $; alternation with the | pipe; and lookahead like (?=…) and (?!…). Tweak one token at a time and watch the highlights update live to understand exactly what each piece does.
Your pattern and test text never leave your device. There's nothing to install and nothing to upload — everything runs locally in JavaScript.
Frequently asked questions
- Which regex syntax does this tester use?
- It uses the browser's native JavaScript (ECMAScript) RegExp engine, so patterns behave exactly as they will in JavaScript, TypeScript, and Node. Features from other dialects such as PCRE lookbehind quirks or Python-specific escapes may differ.
- Why does my pattern only find the first match?
- Without the g (global) flag, JavaScript stops at the first match. Turn on the g flag to find every match in the string. The tool reminds you when g is off.
- Is my pattern or test text sent anywhere?
- No. Everything runs entirely in your browser using local JavaScript. Your regular expression and test string are never uploaded, logged, or shared.
Related tools
- JSON ValidatorCheck if JSON is valid, pinpoint syntax errors by line and column, and see a structure diagnostic, in-browser.
- Diff CheckerCompare two texts line by line and see exactly what was added, removed, or unchanged — in your browser.
- JSON FormatterFormat, minify, and validate JSON in your browser — pretty-print or compress with pinpoint error locations.
- Excel Keyboard ShortcutsSearch practical Excel shortcuts by action, platform, and category, then copy the exact keys you need.
- JWT DecoderDecode a compact JWT header and payload locally, with a clear unverified warning.
- Subnet CalculatorEnter an IP and CIDR prefix or subnet mask to instantly get network, broadcast, host range, and mask details.