Regular expressions in brief
A regular expression describes a pattern of text. \d+ matches one or more digits, [A-Z] one capital letter, \b a word boundary, (…) captures a group, ? makes something optional and * repeats it. Flags change the behaviour: g finds all matches, i ignores case, m makes ^ and $ match at line breaks, s lets . match newlines, and u enables full Unicode.
This tester uses JavaScript's engine, the same one your browser, Node.js and most front-end code run, so a pattern that works here works there. Other languages (Python, PCRE, Java) share most syntax but differ in details.
Worked example
Pattern (\d{4})-(\d{2})-(\d{2}) against Due 2026-10-17 finds one match, 2026-10-17, with groups 2026, 10 and 17. With the replacement $3/$2/$1 the text becomes Due 17/10/2026.
Avoiding slow patterns
Nested quantifiers such as (a+)+$ can take exponential time on near-matches and freeze the tab. Prefer specific character classes and anchors.
How this works
The page compiles your pattern with JavaScript's RegExp and the flags you typed, reporting syntax errors as the engine words them. It then runs the pattern over the text with the global flag so every match is found; if you left g out, only the first match is listed, as exec would return. Each match shows its index and its capture groups (∅ for a group that did not participate). If you enter a replacement, the page applies String.replace, with $1, $<name> and $& references. Everything runs in this tab.
Frequently asked
Which regex flavour is this?
JavaScript (ECMAScript). Most syntax is shared with PCRE, Python and Java, but lookbehind, named groups and Unicode escapes follow the JavaScript rules.
How do I use a capture group in the replacement?
Write $1, $2… for numbered groups or $<name> for named ones. $& inserts the whole match.
Why is only one match shown?
Without the g flag a regex stops at the first match. Add g to the flags.
Is my text sent anywhere?
No. Matching runs in your browser.
Sources
- ECMA-262 — ECMAScript Language Specification
- The Unicode Standard, latest version
- Wikipedia — Regular expression
Reviewed Oct 17, 2026 · test vectors fixtures/dev/regex-tester/