Free Online Regex Tester
Test and debug regular expressions in real time. See matches highlighted and cap...Test and debug regular expressions in real time. See matches highlighted and capture groups extracted with a built-in cheat sheet.
Updated
Regex Cheat Sheet
Characters
.Any character\dDigit [0-9]\wWord [a-zA-Z0-9_]\sWhitespace
Quantifiers
*0 or more+1 or more?0 or 1{n,m}n to m times
Anchors
^Start of string$End of string\bWord boundary\BNon boundary
Groups
(abc)Capture group(?<n>abc)Named group(?:abc)Non capture[abc]Character class
Quick answer
A regex tester lets you build and check a regular expression against sample text, highlighting the matches and showing the capture groups. This one runs entirely in your browser on the native JavaScript RegExp engine, so patterns and test data are never uploaded. Type a pattern, toggle flags like g, i, m, s, u and y, and watch matches highlight live with numbered and named groups plus a replace preview.
Tester Features
Why Use Free Online Regex Tester?
Real-Time Matching
See matches highlighted instantly as you type. No need to click buttons or wait for results.
Capture Group Details
View each capture group separately with clear labeling. Perfect for complex patterns with multiple groups.
Replace Mode
Test find-and-replace operations with group references ($1, $2). Preview the result before using in your code.
Built-in Cheat Sheet
Quick reference for common regex syntax. Character classes, quantifiers, anchors, and groups at a glance.
Common Uses for Regex Tester
Email Validation
Test and refine email validation patterns for forms and input fields.
Code Refactoring
Build find-and-replace patterns for bulk code changes across files.
Log Parsing
Extract specific data from log files using capture groups.
Input Sanitization
Create patterns to validate and sanitize user input in applications.
How It Works
Enter Your Pattern
Type your regular expression in the pattern field. Use the common patterns buttons for quick templates like email or phone validation.
Configure Flags
Select flags to modify matching behavior. Use Global to find all matches, Case Insensitive for flexible matching, or Multiline for line based patterns.
Test and Refine
Enter test text to see matches highlighted in real-time. View capture groups in the details panel. Enable replace mode to test substitutions.
Regex Tips
Start Simple
Build your regex incrementally. Start with a simple pattern that matches broadly, then add specificity. Test each change in real-time.
Use Common Patterns
Click the pre-built pattern buttons for email, URL, or phone validation as starting points, then customize for your specific needs.
Escape Special Characters
Characters like . * + ? { } [ ] ( ) | \ ^ $ have special meaning in regex. Use a backslash (\) to match them literally.