Regex Tester

Test JavaScript regular expressions with live match highlighting

/ /
 
No matches yet.
Cheatsheet
\d digit · \w word · \s whitespace
\D non-digit · \W non-word · \S non-whitespace
. any · ^ start · $ end
* 0+ · + 1+ · ? 0–1 · {n,m}
[abc] set · [^abc] not in set · [a-z] range
(...) group · (?:...) non-capturing · (?<n>...) named
| or · \b word-boundary · \B not boundary
(?=...) lookahead · (?!...) negative · (?<=...) lookbehind
Your files never leave your browser. Nothing is uploaded to any server. Privacy Policy

Build, test and debug JavaScript regular expressions with live match highlighting, capture group inspection and a quick reference cheatsheet. Useful for validation patterns, search and replace, log parsing and form input.

How to test a regular expression

1
Enter your pattern

Type the regex without slashes — e.g. \\d+ for one or more digits.

2
Add test text

Paste the text you want to match against in the test field.

3
Inspect matches

Each match and capture group is shown with its position and value.

🔍
Live highlighting

Matches are highlighted in your test string as you type the pattern.

🏷
Capture groups

Each match is broken down by group number and named groups.

⚙️
All flags

Toggle g, i, m, s, u and y flags individually to see how matches change.

📚
Cheatsheet

Built-in reference for common metacharacters, character classes and quantifiers.

FAQ

JavaScript ECMAScript regex — the same engine used in browsers and Node.js.

Modern JavaScript engines support lookbehind ((?<=...)), named groups ((?<name>...)) and Unicode property escapes (\\p{...}) with the u flag.

g = global (find all), i = case-insensitive, m = multi-line, s = dot matches newline, u = Unicode, y = sticky.

Check that special characters are escaped (\\. \\( \\)) and that the right flags are enabled. Use the cheatsheet for reference.

No. The tester runs the regex locally using your browser's JavaScript engine.

More free tools