Regex Tester - Test Regular Expressions Online Free
Test and debug regular expressions (regex) in real-time. Match patterns, extract groups, and validate your regex with instant feedback. Supports JavaScript regex syntax with global, case-insensitive, and multiline flags.
Why Use Regex Tester?
- Live Testing: See matches highlighted in real-time
- Capture Groups: View and extract matched groups
- Multiple Flags: Test with g, i, m, s, u, y flags
- Error Detection: Identify syntax errors instantly
Common Use Cases
✅ Validation
Validate email addresses, phone numbers, URLs.
🔍 Search & Replace
Find and replace patterns in text.
📊 Data Extraction
Extract specific data from logs and files.
🧹 Data Cleaning
Clean and normalize text data.
How to Use This Tool
- Enter Pattern: Type your regular expression pattern in the first field.
- Set Flags: Check the flags you need (global, case-insensitive, multiline).
- Test Text: Enter or paste your test text - matches are highlighted automatically.
💡 Tip: Use capturing groups () to extract specific parts of your matches.
Regular Expression Tester
Common Regex Patterns
\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b
Matches email addresses
Phone Number
\(?(\d{3})\)?[-.\s]?(\d{3})[-.\s]?(\d{4})
Matches US phone numbers
URL
https?://[^\s]+
Matches HTTP/HTTPS URLs
IPv4 Address
\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
Matches IP addresses
Date (MM/DD/YYYY)
\d{2}/\d{2}/\d{4}
Matches date format
Hex Color
#[0-9A-Fa-f]{6}
Matches hex color codes
Regex Syntax Quick Reference
.- Any character except newline^- Start of string$- End of string*- 0 or more occurrences+- 1 or more occurrences?- 0 or 1 occurrence{n}- Exactly n occurrences{n,m}- Between n and m occurrences
[abc]- Any character a, b, or c[^abc]- Not a, b, or c[a-z]- Any lowercase letter\d- Any digit [0-9]\w- Any word character [A-Za-z0-9_]\s- Any whitespace\b- Word boundary()- Capture group
Regex Flags Explained
g- Global: Find all matches, not just the firsti- Case insensitive: Match both upper and lowercasem- Multiline: ^ and $ match line breakss- Dot all: . matches newlines toou- Unicode: Treat pattern as Unicode code pointsy- Sticky: Match from lastIndex position
Related Tools
- Text Diff - Compare two texts
- Character Counter - Count text statistics
- Case Converter - Convert text case