Regex Tester
Test JavaScript regular expressions live — matches, capture groups, and errors update as you type.
Inputs
Results update liveCommon patterns
Starting points, not universal validators — always check the matches against your real data.
- Email-like: Common email-shaped pattern. Not a full RFC 5322 validator.
- URL: Matches http/https URLs up to the next whitespace.
- IPv4-shaped: IPv4-shaped dotted quads; does not check the 0–255 range.
- ISO date: YYYY-MM-DD shape; does not validate real calendar dates.
- Hex colour: #RGB or #RRGGBB hex colour codes.
- UUID: Canonical 8-4-4-4-12 UUID shape.
- Duplicate whitespace: Runs of two or more whitespace characters — handy before cleanup.
- Number: Integers and decimals, optional leading minus.
Pattern structure (2 recognized constructs)
\d— digit (0–9)+— one or more
2 matches
2 matches found (global flag enabled).
Evaluated in 0 ms on this device.
Hello 123 World 456
- Match 1:
"123"characters 6–9 - Match 2:
"456"characters 16–19
Worked examples — load one and inspect it
Interpretation
How the Regex Tester works
This tester evaluates your pattern with the JavaScript RegExp engine built into your browser — the same engine your web code uses. Matches, capture groups, and errors update live as you type. Everything runs locally on your device; nothing is uploaded. Because evaluation is synchronous, a pathological pattern (nested quantifiers such as (a+)+) can briefly freeze the tab on large input — the elapsed-time readout makes slow patterns visible instead of mysterious.
Example
Worked example
A realistic scenario showing how the calculation guides a practical decision.
Worked example
inputOrder 2048 shipped on 2026-05-17
operation/\d+/g — find every run of digits
result4 matches: 2048, 2026, 05, 17
What it means: The global flag returns all four digit runs as separate matches, each with its position. Loading the Extract numbers example above reproduces this exact result in the tool.
Watch out
Common mistakes
- Build complex patterns incrementally — start with the simplest pattern that matches, then add specificity, and use non-capturing groups (?:...) when you need grouping without extraction.
- Nested quantifiers such as (a+)+ can backtrack catastrophically. This tool runs synchronously in your browser and cannot interrupt a runaway pattern — watch the elapsed-time readout on large inputs.
- A pattern that matches a sample is not a validator. Test against real data, including inputs that should NOT match.
Related tools