What is a regex tester?
A regex tester lets you write a regular expression and see immediately what it matches against a sample string — every match is highlighted in place and listed with its index and capture groups, updating on each keystroke. That instant feedback loop is the difference between confidently shipping a pattern and discovering in production that it matched too much or too little.
This tester uses JavaScript's native RegExp engine, so what matches here is exactly what will match in Node.js and the browser. Your pattern and test string never leave your machine.
When to use it
Use it while writing validation (emails, slugs, version strings), extracting values from logs or scraped text, building search-and-replace expressions for your editor, or debugging a pattern that behaves differently than you expect. The flag toggles cover the four you'll reach for most: g finds all matches instead of just the first, i ignores case, m makes ^ and $ match at line boundaries, and s lets . match newlines.
Capture groups are shown separately for each match, which makes it easy to check that your parentheses are grabbing the piece you actually want — the most common source of off-by-one regex bugs.
Example
To pull semantic versions out of a changelog, try the pattern (\d+)\.(\d+)\.(\d+) with flags gi against a few lines of release notes. Each match lists three groups — major, minor, patch. When it works, use "Copy link to this result" to share the pattern with your test string embedded in the URL, so a teammate opens exactly what you're looking at.
How to use the JavaScript Regex Tester with Capture Groups tool
- 1
Write your pattern
Type the regular expression between the slashes — no escaping of forward slashes needed.
- 2
Toggle flags
Enable g (global), i (case-insensitive), m (multiline) or s (dotall) as needed.
- 3
Paste a test string
Matches highlight in real time, with index positions and capture groups listed below.
- 4
Share it
Copy a permalink that carries the pattern, flags, and test string to whoever needs to review it.
Frequently asked questions
Which regex flavor does this use?
JavaScript's built-in RegExp engine — the same one in Node.js and every browser. Patterns may behave slightly differently in PCRE (PHP), Python's re, or Go's RE2, especially around lookbehind and Unicode.
Why does my pattern match nothing?
Check that special characters you meant literally (., +, ?, parentheses, brackets) are escaped with a backslash, and that the case-insensitive flag is on if capitalization varies. An error banner appears if the pattern itself is invalid.
Is my test data sent anywhere?
No. Matching runs entirely in your browser — patterns and test strings are never uploaded or logged.
How do I match across multiple lines?
Enable the m flag so ^ and $ anchor at each line, and the s flag if you need the dot to match newline characters too.
Related on TechLogHub
Related Text Tools
Get the next tool before you need it
One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.

