Regex Tester & Debugger
Test regular expressions with live matching. See all matches, captured groups, and highlighted results.
Match Summary:
---
How to Use
- Enter pattern – Type your regex pattern in the Pattern field
- Select flags – Choose any flags you need (global, case-insensitive, etc.)
- Add test text – Paste the text you want to test against
- See matches – Matches are highlighted and details shown below
Common Regex Patterns
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$– Email addresshttps?://[^\s]+– URL\b\d{3}-\d{3}-\d{4}\b– Phone number (XXX-XXX-XXXX)^\d{4}-\d{2}-\d{2}$– Date (YYYY-MM-DD)\b[A-Z][a-z]+\b– Capitalized words\d+– One or more digits[a-z]+– One or more lowercase letters
Example
Pattern: \b(\w+)@([\w.]+)\b (with global flag)
Test Text: contact alice@example.com or bob@company.co.uk here
Matches:
- Match 1: alice@example.com → Group 1: alice, Group 2: example.com
- Match 2: bob@company.co.uk → Group 1: bob, Group 2: company.co.uk
Regex Syntax Basics
- . – Any character except newline
- \d – Digit (0-9)
- \w – Word character (a-z, A-Z, 0-9, _)
- \s – Whitespace (space, tab, newline)
- ^ – Start of string (or line in multiline mode)
- $ – End of string (or line in multiline mode)
- * – Zero or more, + – One or more, ? – Zero or one
- [abc] – Match any of a, b, or c
- () – Capture group
Related Tools
- JSON Formatter – Format and validate JSON
- EDA Text Augmenter – Generate text variations
- Base64 Encoder – Encode/decode text
- Token Counter – Count tokens in text