📖 What is Regex Tester?
A Regular Expression (regex) is a pattern that describes a set of strings. The Regex Tester lets you write a pattern, test it against sample text, and instantly see all matches, capture groups, and their positions — making regex development and debugging much faster.
💡 Example
Input
Emails: alice@example.com, bob@test.org
Pattern: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
Output
✓ 2 match(es)
Match 1: alice@example.com at index 8
Match 2: bob@test.org at index 27
🛠️ Common Use Cases
- Validating form inputs (email, phone, URL)
- Extracting data from log files
- Search and replace in code editors
- Parsing structured text like CSV or markdown
- Writing input sanitization rules
❓ Frequently Asked Questions
What regex flags are supported? ▾
All JavaScript flags: g (global — find all matches), i (case insensitive), m (multiline), s (dotAll — dot matches newlines), u (unicode).
What is a capture group? ▾
Parentheses in a regex create capture groups. For example, (\d+)-(\w+) captures the number and word separately. Capture groups let you extract specific parts of a match.
What is the difference between .* and .+? ▾
'.*' matches zero or more characters (including empty string). '.+' matches one or more characters (requires at least one). '.*?' and '.+?' are their non-greedy versions.
Why does my regex match too much? ▾
Your regex is probably greedy. Add '?' after quantifiers (* + {n,m}) to make them non-greedy, or use more specific character classes instead of the dot '.'.
🔒
Your data stays private. All processing happens entirely in your browser using JavaScript. Nothing is ever sent to our servers. You can even use this tool offline after the page loads.