Regex Tester Online – Test JavaScript RegExp Free
Test your pattern live, group by group.
At a glance
- Input:
- A pattern and test text you type or paste
- Processing:
- Runs locally in your browser
- Privacy:
- Nothing you type is sent to a server
Last updated: 2026-11-10
Common use cases
- Checking an email pattern against a real inbox export before shipping it
- Pulling dates out of a log file with named groups for year, month and day
- Reformatting 2026-12-07 into 07/12/2026 with a $3/$2/$1 replacement
- Proving a password rule accepts S3cure!Pass and rejects weakpass
About this tool
Type a pattern and test text, and watch every match light up live — with the match count, a group explorer for numbered and named groups, and a replacement preview. Flags g, i, m, s and u toggle with one click, and the cheat sheet loads common patterns (email, URL, IPv4, date, strong password) with sample text. This is the JavaScript RegExp engine, and matches run in a background worker with a 2-second timeout — a slow pattern shows a named error instead of freezing the tab. Nothing is uploaded.
How to use it
- Type your pattern (or load a preset from the cheat sheet).
- Toggle the flags — g finds all matches, i ignores case, m makes ^ and $ match line starts and ends.
- Paste your test text and click a highlighted match to inspect its groups.
- Type a replacement ($1, $&, $<name>) to preview the rewritten text.
Worked examples
Input: Contact ana@example.com or bob.smith@company.co.uk for details.
Output: 2 matches: ana@example.com, bob.smith@company.co.uk
The email preset with the g flag — both addresses light up; without g you would see only the first.
Input: Launch: 2026-12-07.
Output: 1 match: 2026-12-07 — year 2026, month 12, day 07
Named groups (?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2}) — the explorer shows each named part of the match.
Input: Date: 2026-12-07.
Output: Date: 07/12/2026.
Replacement $3/$2/$1 on (\d{4})-(\d{2})-(\d{2}) — the day, month and year swap places.
Practical tips
- Turn on g when you want every match — without it the tester stops at the first one.
- Test the pattern against text that should NOT match too — a pattern that matches everything tells you nothing.
- Use \b around short patterns (\b\d{4}-\d{2}-\d{2}\b) so 12026-12-07 does not match inside a longer number.
Common mistakes
- Writing a PCRE pattern and wondering why it fails — (?>...), a*+ and (?P<name>...) do not exist in JavaScript; the page flags them by name.
- Forgetting the g flag and concluding a pattern matches once — it matched once because you asked for one.
- Using .* to skip text and getting a greedy match across the whole line — use [^...]* or .*? to stop where you mean.
How this compares
regex101 is the reference tester with a debugger and a large community library, but it is a full workbench that wants an account for saving. This page is the fast check: type, see the highlights, inspect the groups, preview the replacement — no account, no upload, and the engine is the same JavaScript RegExp your code will run. The tradeoff: no step-by-step debugger and no saved patterns — for deep debugging, regex101 is still the place.
Good to know
- JavaScript RegExp only — no PCRE or Python features; unsupported constructs are flagged, not run.
- Patterns up to 2,000 characters, test text up to 250,000 characters, 10,000 matches shown.
- A 2-second worker timeout — patterns that backtrack catastrophically show a named error instead of running.
- The IPv4 and date presets match the shape only — 999.999.999.999 and 2026-13-99 would match too.
Frequently asked questions
Which regex flavour is this?
JavaScript RegExp — the same engine your browser runs. Lookbehind (?<=...) works in modern browsers, but PCRE features like atomic groups (?>...), possessive quantifiers (a*+) and Python-style (?P<name>...) groups do not exist in JavaScript, so this page flags them instead of silently mis-testing your pattern.
What if my pattern is too slow?
Matches run in a background worker with a 2-second timeout. A slow pattern shows a named error instead of freezing the tab. The usual fix: avoid nested quantifiers like (a+)+ and overlapping alternatives like (a|aa)+ — both are classic backtracking traps.
How large can the pattern and text be?
Patterns up to 2,000 characters and test text up to 250,000 characters. Matches are capped at 10,000 — narrow the pattern or the text to see the rest.
How do named groups work?
Write (?<year>\d{4}) and the group explorer shows year: 2026 for each match. In the replacement box, $<year> inserts the same group. Numbered groups work the same way with $1, $2 — and $& inserts the whole match.
Is my pattern or text uploaded?
No. The pattern, the flags and the test text never leave this tab — the match runs entirely in your browser.

