Developer tools
Regex Tester
Test JavaScript regular expressions with flags against sample text locally in your browser.
Enter a JavaScript regular expression without slashes, choose flags, then add sample text. Matching runs locally in your browser; your pattern and text are not uploaded or stored.
Check a regex before you ship it.
Enter a JavaScript regular expression without slashes, choose g, i, m, s, u, or y flags, then add sample text to see match count, matched text, index, and capture groups. Everything runs locally in your browser, so your pattern and text are not uploaded or stored.
Frequently Asked Questions
Everything you need to know about this tool, how it works, and privacy.
What does the regex tester check?
Enter a JavaScript regular expression without surrounding slashes, choose flags, and add sample text. The tester reports how many matches were found plus each matched text, its index, and any capture groups. For example, pattern (w+)@(w+.w+) with the g flag finds email-like matches in contact text.
Which flags are supported?
The tester supports g for global matching, i for case-insensitive matching, m for multiline anchors, s so dot matches line breaks, u for Unicode-aware matching, and y for sticky matching. Without g or y, only the first match is reported.
Which inputs are accepted?
Enter a pattern up to 2000 characters and sample text up to 50000 characters. Empty patterns, empty sample text, invalid expressions, and more than 200 matches show a clear error instead of a result.
Do my pattern and text stay private?
Yes. The test and copy action run locally in your browser. CodeASystem does not upload or store the pattern, flags, or sample text you enter.