Add your input
A JavaScript regex pattern, flags, and test text.
Iterate on a pattern and see each match immediately.
Your work stays private in your browser while you use this tool.
Run a JavaScript regular expression over sample text, highlight non-empty matches, and list each match's index, numbered captures, and named groups. The scan collects up to 500 matches.
A JavaScript regex pattern, flags, and test text.
Iterate on a pattern and see each match immediately.
Match positions, captured text, and groups.
Avoid catastrophic backtracking patterns before using a regex on untrusted or very long input.
Test a validation or extraction pattern against representative strings before adding it to JavaScript.
Inspect capture groups and match positions while debugging a replacement workflow.
Compare the effect of flags such as i, m, s, u, or v on the same text.
The page validates flags against d, g, i, m, s, u, v, and y and rejects duplicates. It constructs a native RegExp, adds g for scanning when absent, and iterates String.matchAll(). Empty matches appear in the result list but are omitted from visual highlighting to avoid overlapping zero-width marks.
Yes. Regex tester is free to use.
Yes. Your work stays private while you use the tool — nothing you enter is uploaded.
The tester adds g to its internal scanning expression so it can show every occurrence. Your other flags are retained.
A zero-length match has an index but no visible characters to wrap. The result record remains useful, while the highlighter filters it out to avoid ambiguous marks.