Regex Tester
Test regex with live highlighting.
- 100% free
- No sign-up
- Private — runs in your browser
- Instant results
Test regular expressions live
A regular expression (regex) is a pattern for finding and extracting text. Writing one is a trial-and-error process, so this tester shows you exactly what your pattern matches as you type — highlighting every match in your test string and counting them. Edit the pattern, flip the flags, and watch the matches update instantly.
The flags
- g (global) — find all matches, not just the first.
- i (ignore case) — match regardless of upper/lowercase.
- m (multiline) —
^and$match line starts/ends. - s (dotall) —
.also matches newline characters.
FAQ
Which regex flavor is this?
JavaScript (ECMAScript) regex — the same engine your browser and Node.js use. Most syntax is shared across languages, but some features (like lookbehind or named groups) vary, so double-check if you're porting a pattern to another language.
Is the regex tester free and private?
Yes, it is free with no sign-up, and your pattern and test string are evaluated entirely in your browser. Nothing you type is uploaded, so it is safe to paste sensitive sample data.
Why are only some matches highlighted?
Without the global (g) flag, the engine stops after the first match, so only one is shown. Turn on g to find and highlight every match in your test string.
Do I include the slashes when entering my pattern?
No, enter only the pattern itself and set the flags separately with the checkboxes. The surrounding slashes from a literal like /abc/g are just delimiters and are not part of the pattern.
Why does my pattern throw an error?
Usually it is an invalid or incomplete expression, such as an unclosed bracket or parenthesis or an unescaped special character. Fix the syntax and the matches update instantly as you type.
Does it work on mobile?
Yes, the tester runs in any modern mobile browser, though a physical keyboard makes typing complex patterns easier.