Regex Tester
Thinkforu.org Regex Tester
Results
Found: 0 matches
User Guide
1. Enter Your Pattern
Type your regular expression in the "Regular Expression" field without the forward slashes.
Example:
- To match email addresses:
\b[\w\.-]+@[\w\.-]+\.\w+\b
- To match phone numbers:
\b\d{3}[-.]?\d{3}[-.]?\d{4}\b
- To match URLs:
https?:\/\/[\w\-\.]+\.\w+
2. Select Flags
Choose appropriate flags for your regex pattern:
- g (Global): Match all occurrences, not just the first one
- i (Case-insensitive): Match "Hello", "hello", and "HELLO"
- m (Multiline): Make ^ and $ match line starts/ends
- s (Dot All): Make . match newlines too
3. Test Your Input
Enter the text you want to test in the "Test String" area.
Sample Test String:
Contact us at: support@example.com sales@company.com Phone: 123-456-7890 Website: https://www.example.com
4. Analyze Results
View matches, try replacements, or get detailed explanations of your pattern.
Features:
- Matches: See all matching text with their positions
- Replace: Try
$1
or$&
for replacements - Explain: Get a breakdown of your pattern
- Pattern:
(\w+)@(\w+)\.com
- Replace with:
[$1 at $2]
- Result:
support@example.com
becomes[support at example]
Frequently Asked Questions
What is a regular expression?
A regular expression (regex) is a sequence of characters that defines a search pattern used for string matching and manipulation.
What are regex flags?
Flags modify how the regex pattern matching behaves. Common flags include 'g' (global), 'i' (case-insensitive), and 'm' (multiline).
How can I save my regex patterns?
You can bookmark the page with your pattern or use the share button to generate a link with your current pattern.
Is this tool mobile-friendly?
Yes! This tool is fully responsive and works great on all devices including smartphones and tablets.