Test JavaScript regular expressions with live match highlighting and captured groups. Runs entirely in your browser.
Runs entirely in your browser with the native JavaScript regex engine.
What the regex tester does
Paste any text, type a JavaScript regular expression, and pick flags (g for global, i for ignore case, m for multiline, s for dotall). The tool lists every match and shows captured groups, all in your browser.
Frequently asked questions
Which regex syntax is supported?
The same engine your browser uses for JavaScript. That covers capture groups, character classes, lookahead and backreferences.
Is my text uploaded?
No. Matching happens in the page, so private logs or drafts never leave your device.
What do the flags mean?
g finds all matches, i ignores case, m makes ^ and $ match line breaks, and s lets . match newlines.
How to use it
- Paste the text you want to search into the input labelled “Paste the text to search…”.
- Type a JavaScript regular expression into the pattern field below the input.
- Check the flag boxes g, i, m, or s to change how the pattern behaves.
- Click the “Run test” button to see the number of matches and a list of each match with its captured groups.
Where it comes in handy
Debugging a 200-character email validation pattern before inserting it into a Node.js script. The tester shows whether \S+ catches spaces or whether the ^ and $ anchors respect multiline input.
Extracting dates from a 500-line log file where each line contains a timestamp in ISO-8601 format (YYYY-MM-DDTHH:MM:SSZ). Switching on the g flag returns every date; turning it off returns only the first occurrence.
Checking a 40-character hex colour pattern against a CSS file with 1,200 declarations. The matches table lists each captured group so you can verify the shorthand #RGB notation expands correctly.
Worth knowing
- The engine follows the ECMAScript 2024 specification. Features such as lookbehind assertions, Unicode property escapes, and the v flag require a browser released after 2020; older browsers throw a syntax error.
- Without the g flag, the tool uses RegExp.prototype.exec once and displays only that single match object. Captured groups are tied to the first match, and lastIndex is reset to 0 after each run.
- Input larger than about 1 MB can block the main thread for several seconds because matching runs synchronously on the page. The browser may show an “unresponsive script” warning before the matches appear.