Regex Tester
Test regular expressions with real-time match highlighting.
//g
About Regex Tester
This tool lets you test JavaScript-compatible regular expressions in real time. Matches are highlighted in the test string, and capture groups are shown in the results table. Supports global (g), case-insensitive (i), multiline (m), dotAll (s), and unicode (u) flags.
Use cases
- Validate email, phone, or ID formats before shipping a form validator.
- Extract URLs, dates, or numbers from a block of log text.
- Debug a pattern that is not matching as you expect by seeing matches highlighted live.
- Prototype a replacement rule before dropping it into your code editor.
Frequently asked questions
Which regex dialect does this tool use?
The JavaScript RegExp engine. Features like lookbehind and named captures are supported in modern browsers.
Why does my pattern only match once?
Without the g (global) flag, only the first match is returned. Enable g to find all matches.
How do I match across newlines?
Use the s flag (dotAll) to make . match newline characters, or use \s explicitly.