Regex Tester
Free regex tester online for JavaScript. Test patterns, see match indices and capture groups in your browser with no upload, no account required.
Runs locally in your browser. Your input is not uploaded to DevToolMate servers.
Safety
Patterns run with a processing timeout and match caps. Nested unbounded wildcards are rejected when they look unsafe.
Developer Quick Tips
- Enter a JavaScript regex pattern and sample text, then press Ctrl/Cmd+Enter to test and see all matches with start indices and capture groups.
- Use the g flag to list all matches up to 5,000; without g, only the first match displays with its index and groups.
- Define capture groups with parentheses in your pattern; Regex Tester labels each group by position and shows captured text for every match.
- Combine flags like gi for global plus case-insensitive matching; unknown flags are stripped automatically.
- Patterns with nested unbounded wildcards like (.*){2,} are rejected to prevent browser slowdown and runaway matching.
Frequently asked questions
How do I test a JavaScript regex pattern online?
Paste your regex pattern and sample text into Regex Tester, add any flags (g, i, m, s, u, y), and press Ctrl/Cmd+Enter. The tool runs locally in your browser and displays each match with its start index and capture groups.
What does the regex match output show?
Each match shows the matched text, start index (position in the sample text), and all capture groups. With the g flag, you get up to 5,000 matches numbered sequentially. Without g, only the first match is shown.
How do I use capture groups in a JavaScript regex?
Use parentheses to define capture groups in your pattern. Regex Tester labels each group by position (group 1, group 2, etc.) and displays the captured text for every match found.
Which JavaScript regex flags are supported?
Regex Tester supports g (global), i (case-insensitive), m (multiline), s (dotAll), u (unicode), and y (sticky). Combine flags as needed, e.g., gi for global plus case-insensitive. Unknown flag characters are stripped.
Why was my regex pattern rejected?
Patterns are rejected if they have invalid syntax, exceed 20,000 characters, or contain nested unbounded wildcards like (.*){2,} that could cause runaway matching. The UI explains which guardrail was triggered.
Does Regex Tester upload my pattern and text to servers?
No. Regex Tester runs entirely in your browser. Your pattern and sample text never leave your device and are not uploaded to DevToolMate servers.
Related tools
- Text Diff: Free text diff online tool to compare two texts line by line in your browser. See added, removed, and unchanged lines instantly. No upload, no account.
- Escape String: Escape string online free - convert raw text to valid JSON string literals in your browser. Handles quotes, newlines, tabs, control characters. No upload, no account.