Regex Tester
Test regular expressions with live match highlighting, capture group inspection, and a match count summary. Supports JavaScript regex syntax.
Related tools
About the Regex Tester
This tool uses the JavaScript built-in RegExp engine, so the results exactly match what you will see in a Node.js or browser environment. Enter your pattern and test string and matches are highlighted in real time as you type — no button to click, no page to reload.
Live match highlighting
Each match is highlighted in a distinct colour directly within the test string, making it easy to see at a glance which parts of the input are matched and which are not. Up to five colours cycle through the matches so overlapping or adjacent groups remain visually distinct. Hovering over a highlighted match shows its position number.
Flags
The g (global) flag is always active so all matches in the test string are found. Toggle additional flags using the buttons in the toolbar:
i— case insensitive:/hello/imatches Hello, HELLO, hElLom— multiline:^and$match the start and end of each line, not the whole strings— dot-all: the.metacharacter matches newline characters as well as all others
Capture groups
The match details table below the test string lists every match, its character index, and the value of each capture group. Both numbered groups ((pattern)) and named groups ((?<name>pattern)) are supported. Groups that did not participate in the match are shown as undefined.
Pattern library
The built-in pattern library provides 20+ ready-to-use patterns across four categories: Web & Network (email, URL, IPv4, domain), Identifiers (UUID, hex colour, semver, JWT), Numbers & Dates (integers, decimals, ISO dates, phone numbers), and Code & Text (HTML tags, CSS selectors, slugs). Clicking a pattern loads it into the tester and populates a sample test string so you can see it working immediately.
Common use cases
- Validating user input patterns before writing production code
- Extracting structured data (emails, dates, IDs) from log files or CSV exports
- Debugging a regex that works in one context but not another
- Learning regex syntax interactively by seeing matches update in real time
- Quickly testing whether a known-good pattern covers an edge case
Privacy
This tool runs entirely in your browser using the JavaScript RegExp engine. Your patterns and test strings are never transmitted anywhere. Learn more about how Dev-Utilities handles privacy.