Regex Tester

Test regular expressions with live match highlighting, capture groups, and every JavaScript flag as you type. Both the pattern and your test text are evaluated entirely in your browser, so nothing is uploaded and it's safe to test against real data.

/ /
Enter a pattern to begin.

Quick answer

A regular expression is a pattern for finding and extracting text. Type a pattern above, toggle flags like g (all matches) and i (ignore case), and paste text to see matches highlighted with their capture groups. It uses your browser's native JavaScript RegExp engine, so results match Node.js and TypeScript exactly, and nothing you type leaves your device.

How to read the results

Flags explained

Flags change how the whole pattern behaves. The two you'll reach for most are g and i:

Syntax cheat sheet

TokenMatches
.Any character except newline (unless s flag)
\d \w \sDigit, word character, whitespace
\D \W \SThe negation of each (non-digit, etc.)
[abc] [^abc]Any one of a/b/c; or any character except them
[a-z0-9]A character range
* + ?0+, 1+, or 0-or-1 of the preceding token
{2} {2,} {2,5}Exactly, at-least, or between-n-and-m repetitions
^ $Start / end of string (or line with m)
\bWord boundary
(abc) (?:abc)Capturing group / non-capturing group
(?<name>abc)Named capture group
a|bAlternation: a or b
(?=abc) (?!abc)Lookahead / negative lookahead

Remember to escape characters that have special meaning when you want them literally — ., (, ), [, ], {, }, *, +, ?, |, ^, $, and \ — by putting a backslash in front. A literal dot is \., as used in the email example above.

Frequently Asked Questions

What regex flavor does this tester use?

It uses the browser's native JavaScript (ECMAScript) RegExp engine, so what you see here matches exactly how the pattern behaves in JavaScript, Node.js, and TypeScript. Most core syntax is shared with other flavors, but features like lookbehind, named groups, and Unicode property escapes follow the JavaScript specification.

What do the g, i, m, s, u, and y flags do?

g (global) finds all matches instead of just the first; i (ignore case) makes matching case-insensitive; m (multiline) makes ^ and $ match at line breaks; s (dotAll) makes the dot match newlines; u (unicode) enables full Unicode and property escapes; y (sticky) anchors each match at lastIndex. Toggle them with the checkboxes and the results update live.

How do I capture part of a match?

Wrap the part you want in parentheses to create a capture group; it appears as $1, $2, and so on under each match. Use (?<name>...) for a named group, which shows up by name. Use (?:...) for a non-capturing group when you need grouping without capturing.

Is my test text sent to a server?

No. Both the pattern and the test text are evaluated entirely in your browser using the native RegExp engine. Nothing is uploaded, so it is safe to test against real logs or data, and the tool works offline.

Why does my pattern match nothing or throw an error?

If the pattern is invalid — for example an unclosed group or bracket — the status line shows the exact syntax error. If it is valid but matches nothing, check whether you need the g flag for multiple matches, the i flag for case, or the m flag for anchors to work per line. Remember to escape literal special characters like . ( ) [ ] with a backslash.