Regex Tester
Test JavaScript regular expressions against sample text with live highlighting, named groups, and quick patterns.
Utility
Regex Tester
Generated on April 25, 2026
Quick patterns…
?What is the Regex Tester?
The Regex Tester runs your regular expression against sample text and highlights every match in real time. Built on the JavaScript regex engine (the same one your browser, Node.js, and React/Vue apps use), so what works here works in your code. Toggle global, case-insensitive, multiline, dotall, and unicode flags with one click. Includes ready-made patterns for emails, URLs, IP addresses, dates, hex colors, phone numbers, and Pakistan CNIC. Capture groups are listed per match for inspection. Useful for log parsing, form validation, code refactoring, and learning regex.
The Formula
Practical Examples
Email match: `[\w.+-]+@[\w-]+\.[\w.-]+` matches `hello@example.com` (use it for quick validation, not strict RFC 5322 compliance).
Pakistan CNIC: `\b\d{5}-\d{7}-\d\b` matches `12345-1234567-1`.
Extract URLs from text: `https?://[\w.-]+(?:/[\w./?%&=-]*)?` with the `g` flag.
Find all hex colors: `#[0-9a-fA-F]{3,8}\b` — useful in CSS / HTML files.
Validate IPv4: `\b(?:\d{1,3}\.){3}\d{1,3}\b` (note: doesn't enforce 0-255 ranges).
Frequently Asked Questions
Popular Conversions
Jump to a ready-made conversion — useful for quick reference and sharing: