Tools Coaster500+ FREE TOOLS
Search

Regex Tester

DEV

Test regular expressions live with match highlighting. Supports all JavaScript regex flags.

//

📖 How to Use Regex Tester

1
Enter your regex pattern
Type your regular expression in the pattern field (without forward-slash delimiters).
2
Set flags
Toggle flags: g (global — find all matches), i (case-insensitive), m (multi-line), s (dotAll).
3
Enter test string
Type or paste the text you want to match against.
4
See matches highlighted
All matches are highlighted in the test string, with match groups listed below.

💡 Examples

Email extraction
INPUT
Pattern: \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b (flag: i)
OUTPUT
Matches all valid email addresses in the text
Date validation
INPUT
Pattern: ^\d{4}-\d{2}-\d{2}$
OUTPUT
Matches dates in YYYY-MM-DD format
URL matching
INPUT
Pattern: https?://[^\s]+
OUTPUT
Matches http:// and https:// URLs

🚀 Pro Tips

Use `\b` word boundaries to match whole words only and avoid partial matches.
`.+` matches one or more of any character (except newline). Use `.*` for zero or more.
Use non-capturing groups `(?:...)` when you group without wanting capture group references.
Test with edge cases: empty string, very long string, Unicode characters, and newlines.
The `?` after a quantifier makes it non-greedy: `.*?` matches as few characters as possible.

Frequently Asked Questions

What regex flavour does this tester use?+
It uses JavaScript's built-in RegExp engine, which is ECMAScript-compliant and supports most standard regex features.
How do I match a literal dot or bracket?+
Escape special characters with a backslash: \. matches a literal dot, \[ matches a literal bracket.
What is the difference between greedy and lazy matching?+
Greedy quantifiers (.*) match as much as possible. Lazy quantifiers (.*?) match as little as possible. Lazy is often better for extracting content between tags.
Can I use this to validate emails or phone numbers?+
Yes — regex is commonly used for format validation. However, for production apps, use well-tested library functions since edge cases in email/phone formats are tricky.

More Developer Tools Tools

JSON FormatterBase64 Encoder/DecoderURL Encoder/DecoderHash GeneratorUUID GeneratorJWT DecoderCSS MinifierHTML Entities Encoder