g global
i case-insensitive
m multiline (^ and $ per line)
s dotAll (. matches newlines)
u unicode
Regex Tester β Free Online Regular Expression Debugger
What does this tester do?
Type a pattern, type a test string, and every match highlights in real time. The Capture Groups panel breaks down what each (β¦) captured, including named groups. Toggle the g, i, m, s, and u flags from the toolbar and watch the result update on every change. When a pattern is invalid, the JavaScript engine's error message appears in the status bar so you can spot the typo without guessing.
How to use
- Type a regex pattern in the toolbar input.
- Toggle flags (g, i, m, s, u) next to the pattern.
- Enter your test string in the left pane β matches highlight live.
- Inspect every match and capture group in the right pane.
- Pick a preset (Email, URL, IP, Hex, Date, Phone) to load a working example, or click a Quick Reference token to insert it into the pattern.
Frequently Asked Questions
What's the difference between the g, i, m, s, and u flags?
g (global) keeps matching past the first hit so you see every match instead of just one. i (case-insensitive) lets [A-Z] match lowercase too. m (multiline) makes ^ and $ match start and end of each line rather than the whole string. s (dotAll) makes . match newlines. u (unicode) enables full Unicode handling β needed for things like \p{Emoji} or astral characters.
Why does my pattern fail with 'invalid regular expression'?
Usually an unescaped special character or an unclosed group. Brackets and parentheses must balance: (foo, [a-z, foo) all throw. Backslashes need doubling inside JavaScript strings if you're copying from code (\\d, not \d). The tool shows the JavaScript engine's error message so you can see exactly what it tripped on.
What are capture groups?
Anything wrapped in (parentheses) is captured separately and shown in the Capture Groups panel. Use them to extract parts of a match β for example, /(\d{4})-(\d{2})-(\d{2})/ captures year, month, day. Use (?:β¦) for grouping without capturing, and (?<name>β¦) for named groups that appear under their name instead of a number.
Does this tool support PCRE or Python regex?
It uses the JavaScript regex engine (ECMAScript), which is close to PCRE but not identical. Lookbehinds work in modern browsers. Named groups use (?<name>β¦) syntax. Recursive patterns and conditional groups from PCRE aren't supported. For most everyday patterns the behavior matches what you'd see in Python or PCRE.
Does this send my regex or test string to a server?
No. The regex compiles and runs in your browser using JavaScript's built-in RegExp engine. Nothing leaves your device.