Regex Tester
Test JavaScript regular expressions in real time. View matches and capture groups.
Matches & capture groups
hello@example.com$1hello$2example.com<user>hello<domain>example.comsupport@devtools.app$1support$2devtools.app<user>support<domain>devtools.appAbout Regex Tester
Write a regex pattern and instantly see all matches highlighted in your test string. Toggle flags (global, case-insensitive, multiline, dotAll, unicode, sticky), inspect every capture group and named group per match, and preview replacement output with a custom replacement string. Built for JavaScript regex syntax — no server required.
All processing happens entirely in your browser using modern web APIs. Nothing is uploaded to our servers — your data stays local and private. Free to use forever.
Common use cases
- Building and testing regex patterns for form validation (email, phone, postal code)
- Extracting data from log files using capture groups
- Writing regex for string search-and-replace in code editors
- Testing named capture groups for structured data extraction
- Debugging regex flags like multiline and dotAll behavior
- Previewing replacement strings before applying them in code
How it works
Creates a RegExp object with your pattern and selected flags, then runs matchAll() on the test string. Each match object contains the full match, index position, and all indexed and named capture groups. Highlighting is generated by splitting the test string around match positions and wrapping matched spans. The replace preview uses String.replace() with your pattern and replacement string.