Regex Tester
Test regular expressions in real time with match highlighting, capture groups, and common pattern library.
Common Patterns
How to Test Regular Expressions
1. Enter your regex pattern in the "Regular Expression" field at the top.
2. Toggle flags as needed: g (global), i (case-insensitive), m (multiline), s (dotAll).
3. Paste your test string below — matches are highlighted instantly in real time.
Online Regex Tester for JavaScript
Test and debug regular expressions with instant visual feedback. Our regex tester uses JavaScript's native RegExp engine, so patterns behave exactly as they would in your code. See matches highlighted in the text, extract capture groups, and view match positions — all updating in real time as you type.
Common Regex Patterns
- Email:
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,} - URL:
https?:\/\/[^\s]+ - Phone number:
\+?[\d\s\-\(\)]{7,15} - IPv4 address:
\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b - Hex color:
#[0-9a-fA-F]{3,8} - Date (YYYY-MM-DD):
\d{4}-\d{2}-\d{2}
Regex Flags Explained
- g (global): Find all matches, not just the first one
- i (case-insensitive): Match uppercase and lowercase letters equally
- m (multiline): ^ and $ match the start/end of each line, not just the whole string
- s (dotAll): The dot (.) matches newline characters too
FAQ
Which regex engine does this use? JavaScript's built-in RegExp engine. Patterns work identically in Node.js, Chrome, Firefox, Safari, and Edge.
Does this support lookbehind? Yes. Modern browsers support positive (?<=...) and negative (?<!...) lookbehind assertions.
Is there a match limit? For safety, the tool shows up to 1,000 matches. This prevents browser freezes on patterns that match very frequently.
Can I use named capture groups? Yes. Use (?<name>...) syntax — named groups are displayed in the results panel.