Regex Tester
Test, debug, and visualize your regular expressions in real time. 100% client-side tool for maximum privacy.
โ Matches
Generate code
Validation
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
^https?:\/\/...
^(?=.*[a-z])(?=.*[A-Z])...
^[0-9]{5}(-[0-9]{4})?$
^[0-9]{5}$
Numbers & IP
^\d+$
^-?\d*\.?\d+$
^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$
^(?:25[0-5]|2[0-4]...)$
Dates & Times
^\d{4}-\d{2}-\d{2}$
^\d{2}/\d{2}/\d{4}$
^\d{2}:\d{2}(:\d{2})?$
Text & Format
^[A-Z][a-z]+$
^[a-z0-9_-]{3,16}$
^[a-z0-9]+(?:-[a-z0-9]+)*$
<[^>]+>
Phone Numbers
^(?:(?:\+|00)33|0)...
^\+?1?\s*\(?[0-9]{3}\)?...
^\+?[0-9]{1,4}?...
Characters
.
Any character (except newline)
\d
Digit (0-9)
\D
Non-digit
\w
Word character (a-z, A-Z, 0-9, _)
\W
Non-word character
\s
Whitespace
\S
Non-whitespace
Anchors
^
Start of string/line
$
End of string/line
\b
Word boundary
\B
Non-word boundary
Quantifiers
*
Zero or more
+
One or more
?
Zero or one (optional)
{n}
Exactly n times
{n,}
n times or more
{n,m}
Between n and m times
*?
Lazy quantifier
Groups
(abc)
Capture group
(?:abc)
Non-capturing group
(?<name>abc)
Named group
\1
Backreference
Assertions
(?=abc)
Positive lookahead
(?!abc)
Negative lookahead
(?<=abc)
Positive lookbehind
(?<!abc)
Negative lookbehind
Special
[abc]
Character class
[^abc]
Negated character class
[a-z]
Character range
a|b
Alternation (or)
\
Escape character
Flags
g
Global - All occurrences
i
Case insensitive
m
Multiline
s
Dot matches all
u
Unicode support
Your data stays on your device. Nothing is sent to our servers.
What is a regular expression?
A regular expression (regex) is a sequence of characters that defines a search pattern. It is used to search, validate, or manipulate text. Regex is essential in programming for string processing, form validation, and data analysis.
Features
Real-time testing
See matches instantly as you type your expression.
Visual highlighting
Matches are highlighted directly in the text for better understanding.
Pattern library
Access a collection of ready-to-use regex patterns for common use cases.
100% private
All processing happens in your browser. No data is sent to the server.
How to use?
Write your regex
Enter your regular expression in the input field. Enable the desired flags.
Test with your text
Paste or type the text to analyze. Matches appear instantly.
Export the code
Copy the generated code in your preferred language (JavaScript, PHP, Python).
Use cases
Email
Email validation
URL
URL extraction
Log
Log file analysis
Code
Find/Replace in code
Frequently Asked Questions
Is my data secure?
Yes, absolutely. All processing happens directly in your browser. Your data is never sent to our servers. You can even use this tool offline once the page is loaded.
What's the difference between the g, i, m flags?
The "g" flag (global) finds all occurrences, not just the first one. The "i" flag makes the search case insensitive. The "m" flag (multiline) makes ^ and $ match the start/end of each line, not just the entire string.
How do I capture groups?
Use parentheses () to create capture groups. For example, (\w+)@(\w+) will separately capture the username and domain of an email address. You can access groups with $1, $2, etc.
Why isn't my regex working?
Make sure you've escaped special characters like . + * ? ^ $ { } [ ] \ | ( ). In JavaScript, some characters need to be double-escaped (\\d instead of \d) when using a string.
Do JavaScript regex work in PHP/Python?
The basic syntax is similar, but there are differences. PHP uses delimiters (//), Python requires importing the re module. Some advanced features may differ between languages.