Matches
🔒 Privacy: everything runs in your browser. Nothing is uploaded.
About this regex tester
Regular expressions are compact patterns for finding and validating text: email addresses, dates, log lines, URLs, IDs. They are also notoriously easy to get slightly wrong. A regex tester lets you see exactly what a pattern matches against sample input before you put it into code, a spreadsheet formula or a search-and-replace dialog.
This tester uses the JavaScript (ECMAScript) regex engine built into your browser, so results match what Node.js, browsers and most front-end frameworks will do. Matches are highlighted inline, and each match is listed with its position and capture groups. Supported flags are g (global), i (case-insensitive), m (multiline), s (dot matches newline), u (Unicode) and y (sticky).
A few habits make patterns more reliable. Anchor validation patterns with ^ and $ so they must match the whole string rather than a fragment. Prefer specific character classes like [0-9] or \d over the catch-all dot. Use non-greedy quantifiers such as .*? when matching between delimiters, otherwise the match may run to the last delimiter on the line. Test with both valid and invalid samples, including empty input and very long strings, because poorly written nested quantifiers can cause catastrophic backtracking. When a pattern becomes hard to read, split the job into several simpler steps in code instead.
How to use it
- Enter your pattern without surrounding slashes, e.g.
\d{4}-\d{2}-\d{2}. - Add flags such as
gi. - Paste test text and review the highlighted matches and capture groups.
FAQ
Is this the same as PCRE or Python regex?
Mostly, but not exactly. Lookbehind, named groups and Unicode classes work in modern JavaScript; possessive quantifiers and some PCRE features do not.
Why is "g" always on?
The tester lists all matches, which requires global mode. Your code may use the pattern without it.
How do I match a literal dot?
Escape it as \. — an unescaped dot matches any character.
Is my data private?
Yes, everything runs locally.