Free Online Regex Tester
Test regular expressions with live matching and highlighting. Support for flags and detailed match information.
Match Preview
0 matches
Key Features
Live Matching
See matches highlighted in real-time as you type your regex pattern or test string.
Detailed Results
View match positions, captured groups, and replacement results instantly.
Flag Support
Toggle regex flags (g, i, m, u) with a single click for different matching behaviors.
Instant Feedback
Test and debug regular expressions with visual highlighting and real-time results.
Frequently Asked Questions
Getting Started
What is a regular expression?
A regular expression (regex or regexp) is a sequence of characters that defines a search pattern for pattern matching within strings -- finding, extracting, validating, or replacing text that matches a specific format. They are supported in most programming languages including JavaScript, Python, Java, PHP, and many text editors.
How do I use this regex tester?
Enter your regular expression pattern in the input field, choose the appropriate regex flags, and paste or type your test string. The tool will instantly highlight all matches and show detailed information about each match including its position and any captured groups.
Is my data safe?
Yes, all pattern matching and text processing happen locally in your browser. Your regular expressions and test data never leave your device. No information is uploaded to any server, logged, or stored.
Regex Flags
What do the flags (g, i, m, u) mean?
i (ignore case) makes matching case-insensitive. g (global) finds all matches in the string instead of stopping after the first match. m (multiline) treats ^ and $ as matching the start and end of each line. u (unicode) enables full Unicode support, allowing patterns to match characters beyond the Basic Multilingual Plane (like emojis).
When should I use the global flag?
Use the global flag (g) when you need to find all occurrences of a pattern in a string, not just the first one -- for example, when extracting all email addresses from a document, all hashtags from a social media post, or all numbers from a log file.
Common Patterns & Examples
How do capture groups work?
Capture groups use parentheses () to extract specific parts of a match during pattern matching. Group 0 is always the full match, group 1 is the first parenthesized sub-expression, group 2 the second, and so on. In replacements, reference groups with $1, $2, etc.
What characters need escaping in regex?
Special characters that carry syntactic meaning must be escaped with a backslash to match them literally. These metacharacters include: . * + ? ^ $ ( ) [ ] { } | \. For example, to match a literal period use \., and to match a backslash itself use \\\\