Regex Tester & Match Highlighter
Test a regular expression against sample text, see matches highlighted live, inspect capture groups, and start from a library of common patterns.
2 matches
- @8: ada@example.com
- @27: sales@scoutmytool.com
About this tool
Regular expressions are powerful but easy to get wrong, and the fastest way to build one is to test it against real text and watch what it matches. This tester takes a pattern and flags (the same JavaScript regex engine your code uses) and highlights every match in your sample text as you type, listing each matchโs position and any capture groups. A library of common patterns โ email, URL, IPv4, dates, hex colors, phone numbers โ gives you a starting point to adapt. Everything runs in your browser with the native RegExp engine, so behavior matches what you will get in JavaScript, and nothing is sent anywhere. Use it to debug a tricky pattern, learn regex by experimentation, or verify a validation rule before shipping it.
How to use it
- Type your regex pattern and flags (g, i, m, etc.).
- Paste or type the test string.
- Watch matches highlight live and review the match list with capture groups.
- Click a common pattern to start from a template.
Frequently asked questions
- What regex flavor does this use?
- It uses the JavaScript (ECMAScript) RegExp engine built into your browser, so the syntax and behavior match exactly what you would get in JavaScript or Node.js code. Other languages (PCRE, Python) differ in some features.
- What do the flags mean?
- g = global (find all matches), i = case-insensitive, m = multiline (^ and $ match line breaks), s = dotAll (. matches newlines), u = unicode, y = sticky. Combine them as needed, e.g. "gi" for global case-insensitive.
- How do I see capture groups?
- Wrap parts of your pattern in parentheses to create capture groups. Each match in the results list shows its groups in order, so you can confirm you are extracting the right sub-strings.
- Why does my pattern match nothing?
- Common issues: forgetting to escape special characters (use \. for a literal dot), missing the global flag when expecting multiple matches, or anchors (^ $) preventing matches in multiline text without the m flag.
- Is my test data private?
- Yes. The pattern and text are evaluated entirely in your browser; nothing is transmitted or stored. You can safely test against sample data.
- Can a regex hang the page?
- Pathological "catastrophic backtracking" patterns can be slow. This tool caps match iteration to stay responsive, but if a complex pattern feels stuck, simplify it โ that slowness would also affect your production code.