RegexLab - free, no upload, runs in your browser
RegexLab is a live regular expression tester: type a pattern and test text and every match is highlighted instantly, with a table of matches, indexes, and capture groups, plus a match count and pattern metrics. All evaluation happens in your browser, so patterns built against production data stay private.
The patterns people test are usually built against real production data - server logs, user records, or payment references. Online regex testers evaluate that text on their own servers, and many log the patterns for their own training. Running the test locally means your data and your pattern both stay on your machine.
RegexLab uses your browser's native RegExp engine, so a pattern that passes here will behave identically in Node.js and modern JavaScript.
The highlight shows you where matches land; the table shows you what they actually captured. Each row lists the match, its start index, and every capture group - the part that catches mistakes like a group that captures more than intended, or a quantifier that swallows the next field.
The metrics row reports the match count and test length at a glance, so a pattern that matches zero or matches-everything is obvious immediately.
Most regex disasters are not syntax errors; they are patterns that backtrack exponentially. Nested quantifiers like (a+)+ and greedy wildcards over long input can freeze a tab. Start with anchors and specific character classes, then loosen the pattern only as far as the tests require.
Test with realistic strings, not just the one example that inspired the pattern. Include an empty string, a very long line, Unicode text, and a near-miss that should not match. If the pattern is meant to validate a whole field, anchor it with ^ and $; otherwise it will happily match a substring.
The JavaScript engine (ECMAScript regex). That is the same engine used in Node.js and modern browsers, so a pattern that works here works there.
g (global), i (case-insensitive), m (multiline), s (dotall), and more - type them into the Flags field.
Yes. Every match row lists its capture groups, so you can verify exactly what group 1, 2, and beyond captured.
No. Pattern evaluation runs in your browser with the native RegExp engine. Nothing is transmitted.
The tool highlights and tabulates up to 5,000 matches and shows the first 200 in the table, which covers realistic test cases.
The pattern is not anchored. Add word boundaries (\b) or start/end anchors (^ and $) so it only matches the intended token.
No. Use a DOM parser or JSON parser. Regex is fine for simple text extraction, but nested markup and escaped strings defeat it quickly.
Paste a sample of the file into the test area. For very large files, test with representative lines rather than the entire document.
Optional groups can match nothing. Check the group index and whether the surrounding pattern requires the group to participate.