Features
Pattern testing
Test regex patterns against text:- Real-time pattern matching
- Visual match highlighting
- Match count and position information
- Support for all JavaScript regex features
The tester uses native JavaScript RegExp, supporting all modern regex features.
Match highlighting
See matches highlighted in context:- Yellow highlighting for matches
- Preserve original text formatting
- Multiple match visualization
- In-context preview
Capture groups
Extract and view captured groups:- See all capture groups for each match
- Group numbering (2, etc.)
- Empty group detection
- Position information for each match
Text replacement
Replace matched text with patterns:- Use capture groups in replacements (2)
- Reference full match with $&
- Preview replacement results
- Test replacement patterns
Flag support
Support for all JavaScript regex flags:- g - Global (find all matches)
- i - Case-insensitive
- m - Multiline (^ and $ match line boundaries)
- s - Dot matches all (including newlines)
- u - Unicode
- y - Sticky (match from lastIndex)
Enable the global flag (g) to find all matches instead of just the first one.
Use cases
Email validation
Validate email addresses:Phone number extraction
Extract phone numbers in various formats:URL matching
Find URLs in text:Date extraction
Extract dates with capture groups:Hex color codes
Find hexadecimal color values:Pattern input
The pattern input includes:- Delimiters - Visual
/delimiters for clarity - Pattern field - Enter regex without delimiters
- Flag checkboxes - Enable/disable flags visually
- Flag descriptions - Tooltip explaining each flag
Match display
The matches tab shows:Highlighted text
Your test string with matches highlighted in yellow.Match details
For each match:- Match number badge
- Position in original text
- Full matched text
- Captured groups (if any)
- Copy button for each match
Match information
Green badge showing total match count.Replace functionality
The replace tab provides:Replacement pattern
Enter replacement text using:- 2, etc. - Captured groups
- $& - Full match
- Plain text - Literal replacement
Replacement result
See the transformed text with all replacements applied.Example replacement
Examples
Click “Examples” to load preset patterns:Email validation
Pattern:[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
Test string: Contact us at [email protected] or [email protected]
Phone numbers
Pattern:\(?\d{3}\)?[-.]?\d{3}[-.]?\d{4}
Test string: Call (555) 123-4567 or 555.987.6543 for assistance
URLs
Pattern:https?://[^\s]+
Test string: Visit https://example.com or http://test.org for more info
Dates (MM/DD/YYYY)
Pattern:(\d{2})/(\d{2})/(\d{4})
Test string: Events on 12/25/2024 and 01/01/2025
Hex colors
Pattern:#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})
Test string: Colors: #FF5733, #333, #00AAFF, and #F0F
Quick reference
The tester includes a quick reference panel:Character classes
\d- Digit (0-9)\w- Word character (a-z, A-Z, 0-9, _)\s- Whitespace.- Any character (except newline without s flag)
Quantifiers
*- 0 or more+- 1 or more?- 0 or 1{n}- Exactly n times{n,}- n or more times{n,m}- Between n and m times
Anchors
^- Start of string (or line with m flag)$- End of string (or line with m flag)\b- Word boundary
Groups and alternation
(x)- Capture group(?:x)- Non-capturing groupx|y- x or y (alternation)[abc]- Any of a, b, or c[^abc]- Not a, b, or c
Keyboard shortcuts
- Cmd/Ctrl + Enter - Test pattern
- Cmd/Ctrl + K - Clear all inputs
- Cmd/Ctrl + C - Copy matches or replacement result