hello@toolivers.com
Regex Tester
Validate JavaScript RegExp patterns in the browser and inspect flags, matches, capturing groups, and replacement output on one page.
Flags
This tool follows JavaScript `RegExp` behavior. The `g` flag affects both match collection and replacement scope.
Common test cases
If your browser supports lookbehind, named groups, and other modern RegExp features, you can test them here as well.
Execution summary
Match results
admin@example.org
Capturing groups
Named groups
SALES@company.io
Capturing groups
Named groups
Replacement preview
Enter a replacement string to preview JavaScript `String.prototype.replace()` with the current flags.
Contact: hello at toolivers.com, admin at example.org, invalid@local CC: SALES at company.io
The `g` flag is active, so replacement is applied across the full text.
Regex tester guide
A regex tester is most useful when it goes beyond syntax validation and shows what the pattern actually does to real text. Small differences in grouping, greediness, anchors, and flags can easily turn into production bugs when working with validation rules, log parsing, text cleanup, frontend form handling, or API response post-processing. This tool is designed to make JavaScript regex behavior visible in one place: pattern, flags, matches, groups, and replacements.
When this tool is especially useful
- Checking whether a validation pattern really matches the examples you expect
- Extracting tokens from logs, CSV data, markup, or templated strings
- Previewing replacement output before changing date, code, or text formats
- Debugging capture groups and named groups in a JavaScript code path
Flag tips
- Check `g` first because it changes both how many matches you see and how replacement behaves.
- `m` only changes how anchors like `^` and `$` behave. Use `s` when `.` must span line breaks too.
- `u` matters for emoji and multilingual text because parsing becomes Unicode-aware.
- `y` is more specialized and is most useful for tokenizers or position-sensitive parsing.
Common mistakes
- Assuming JavaScript, PCRE, Python, Java, and grep regex syntax all behave the same way
- Forgetting that backslashes often need double escaping inside source strings
- Testing without `g`, then assuming the replacement behavior will still affect every match
- Misreading multi-line input because `m` and `s` solve different problems