Regex Tester
Test and debug regular expressions with real-time match highlighting and capture groups.
Pattern
Test Text
Highlighted Text
Matches
Ready — enter input to start
Frequently Asked Questions
What is Regex Tester used for?
Regex Tester helps you build, debug, and validate regular expressions by showing real-time matches against your test text. It highlights all matches and displays capture groups, making it ideal for extracting data patterns, validating input formats, searching and replacing in text processing, and learning regex syntax.
How do I use the regex flags (g, i, m)?
The global flag (g) finds all matches instead of stopping at the first one. The case-insensitive flag (i) makes the pattern match regardless of capital or lowercase letters. The multiline flag (m) changes how ^ and $ anchors work, making them match the start and end of each line rather than the whole string.
What are capture groups and how do they work?
Parentheses in a regex create capture groups that extract portions of the matched text. Each group appears as $1, $2, etc. in the output. For example, in the pattern `(\w+)@(\w+)\.(\w+)`, the three groups capture the username, domain, and TLD separately, making it easy to extract and reuse those components.
Is my data sent to a server?
No. All regex matching happens in your browser using JavaScript's native RegExp engine. Your pattern and test text never leave your device, making this safe for testing with sensitive data or proprietary formats.
Why is my regex not matching anything?
Check for syntax errors shown in red, verify your flags are set correctly (especially global vs single match), and ensure special characters are properly escaped. Remember that . matches any character except newline by default, and that the pattern needs to match the exact text you are testing against.
What is a common regex pattern I should know?
For email validation, a basic pattern is `[\w.-]+@[\w.-]+\.\w+`, though full RFC-compliant email regex is extremely complex. For matching URLs, try `https?://[\w.-]+(?:/[\w./-]*)?`. For dates, `\d{4}-\d{2}-\d{2}` matches ISO format. Start simple and add complexity as needed rather than writing comprehensive patterns from the start.