How to use the Regex Tester
- 1Type your pattern into the JavaScript Regular Expression input box without leading or trailing slashes.
- 2Click any combination of the five flag buttons—g (global), i (ignore case), m (multiline), s (dotAll), and u (unicode)—to update matching behavior immediately.
- 3Paste or edit sample text inside the Test String textarea.
- 4Review the Live Highlighted Matches panel and the numbered breakdown table below, then click Copy Matches if you want to save matched offsets.
What the Regex Tester does
Regex Tester evaluates ECMAScript regular expressions locally via your browser JavaScript RegExp engine with safety guards and capture-group inspection:
- Toggles standard JavaScript flags g, i, m, s, and u interactively and displays the total match count above the highlighted preview.
- Highlights every matched range inline inside the Test String preview box so you can verify boundaries visually.
- Displays a structured table of the first 50 matches listing match number (#), starting character Index, Full Match text, and numbered Capture Groups separated clearly.
- Stops safely after 2,000 iterations and advances zero-length matches to avoid infinite browser loops, while displaying native syntax error messages when a pattern is invalid.
Example
Contact support@example.com or billing@test.org for help.
Match #1 (index 8): "support@example.com" | Group 1: "support" | Group 2: "example.com" Match #2 (index 31): "billing@test.org" | Group 1: "billing" | Group 2: "test.org"
Both email addresses highlight inline inside Live Highlighted Matches while Capture Groups split each local part and domain automatically.
Frequently asked questions
Which regular expression flavor does Regex Tester use?
It runs directly on your browser native JavaScript (ECMAScript) regular expression engine, making results match Chrome, Firefox, Safari, and Node.js behavior.
What do the g, i, and m flags do?
g (global) finds every match in the text instead of stopping at the first one. i (case-insensitive) ignores uppercase/lowercase differences. m (multiline) lets ^ and $ match the start and end of each line.
How do capture groups work in the match details?
Wrapping part of your pattern in parentheses like (\w+) creates a numbered capture group ($1, $2, and so on). Each match row lists every captured group substring alongside its character start index.
What happens if I type an invalid regex syntax?
The tester catches RegExp syntax errors immediately and displays an inline error message describing the problem (such as an unterminated group) without crashing the page.
Related tools
View All ToolsFind and Replace Text
Find and replace words, phrases, or regex patterns in text with case-sensitive and whole-word options plus live match count.
URL Parser
Break down any complex URL into protocol, host, port, path segments, search parameters, hash fragments, and domain extension.
JSON Validator
Validate JSON syntax with line-and-column error highlighting for malformed brackets, missing commas, or quote issues.