Regex Tester
Test regular expressions against sample text in real-time with live match highlighting and capture group inspection.
Highlighted matches will appear here...
Online Regular Expression Tester
Regular expressions are one of the most powerful tools in a developer's toolkit. Our Regex Tester provides real-time match highlighting as you type, so you can immediately see whether your pattern matches the right parts of your text without running any code.
Toggle flags like global, case-insensitive, multiline, and dot-all to refine your pattern. View capture groups for each match to verify nested extraction logic. The regex engine runs entirely in your browser using JavaScript's native RegExp implementation.
Regex Tester Features
- Real-Time Highlighting — Matches are highlighted instantly as you type your pattern, giving immediate visual feedback.
- Capture Group Inspection — Each match shows its parenthesized capture groups in the details panel for easy verification.
- Flag Toggles — Switch between global, case-insensitive, multiline, and dotAll modes with a single click.
- Match Count — See the total number of matches at a glance to verify your pattern is matching the expected number of occurrences.
- Match Index — Each match displays its position in the string, useful for debugging complex patterns.
- Error Detection — Invalid regex patterns show clear error messages to help you fix syntax issues quickly.
Common Regex Patterns
Email Validation — Use patterns like [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,} to validate email address format.
Phone Numbers — Match phone numbers in various formats using digit classes and optional grouping characters.
URL Matching — Extract URLs from text using patterns that match http/https protocols followed by domain and path components.
Date Extraction — Parse dates in formats like YYYY-MM-DD, DD/MM/YYYY, or Month Day, Year from unstructured text.
Log Parsing — Extract timestamps, error codes, and messages from server logs using capture groups for structured data extraction.
Frequently Asked Questions
What regex flavor does this tool use?
This tool uses JavaScript's built-in RegExp engine, which follows the ECMAScript specification. It supports features like lookahead, lookbehind, named capture groups, and Unicode property escapes.
What flags are supported?
The regex tester supports four flags: g (global — find all matches), i (case-insensitive), m (multiline — ^ and $ match line boundaries), and s (dotAll — . matches newlines).
Can I test capture groups?
Yes. Each match shows its capture groups in the match details panel, so you can verify that your parenthesized sub-expressions extract the right data.