Regex Tester Online – Real-time Match, Capture Groups, Replace Tool
Templates:
Flags:
Test Text
Matches: 0
Match Result
Preview...
- Enter a regex pattern or select a common template
- Toggle flags to adjust matching mode
- Enter test text in the input area
- View match results and capture group details
- Optional: Use replace function for text substitution
Help
FAQ
What do regex flags do?ShowHide
g=global (find all matches), i=case-insensitive, m=multiline, s=dotAll (. matches newline), u=Unicode mode, y=sticky match
How to view capture groups?ShowHide
Wrap regex parts with parentheses (). The results panel shows each capture group's content and index.
How does regex replace work?ShowHide
Expand "Replace Function", enter replacement text (supports $1, $2 etc. for group references), click replace to see results.
What common templates are available?ShowHide
Email, phone number, URL, IP address, date, number, Chinese characters, HTML tags and more.
Is my data uploaded?ShowHide
No. All testing happens locally in your browser. Nothing is uploaded to any server.
Quick Start
- Enter a regex pattern or select a common template
- Toggle flags to adjust matching mode
- Enter test text in the input area
- View match results and capture group details
- Optional: Use replace function for text substitution
Privacy Notice
Full guide
Regex Tester Online
Features
- Real-time Match Preview - Match as you type, highlighted results
- Capture Group Display - Clearly shows each group's content
- Regex Replace - Supports capture group references
- Common Templates - One-click load for email, phone, URL, etc.
- Flags Toggle - Intuitive matching mode switches
- Local Storage - Save your frequently used patterns
Regex Basics
Regular Expressions are powerful pattern matching tools used for:
- Form Validation - Email, phone, ID card format checking
- Text Processing - Search, replace, extract specific content
- Data Cleaning - Log analysis, format conversion
- Web Scraping - Extract specific information from pages
Common Regex Patterns
| Purpose | Pattern |
|---|---|
[\w.-]+@[\w.-]+\.\w+ | |
| Phone (US) | \d{3}[-.]?\d{3}[-.]?\d{4} |
| URL | https?://[\w./-]+ |
| IP Address | \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} |
| Date | \d{4}-\d{2}-\d{2} |
| Number | -?\d+\.?\d* |
| HTML Tag | <[^>]+> |
Related Tools
- JSON Formatter - JSON formatting and minification
- Text Diff - Text comparison tool
- Smart Detect - Auto-detect format