Regex Tester
Test a regex against your text, with live highlights and a replace preview.
Common patterns
- Email address
- URL
- IPv4 address
- UUID
- Hex color
- Date (YYYY-MM-DD)
- Time (24-hour)
- US phone number
- Phone number (E.164)
- US ZIP code
- Credit card number
- URL slug
- Username
- Strong password
- HTML tag
- Semantic version
- MAC address
- JSON Web Token
- Hashtag
- @mention
- Number
- Leading and trailing whitespace
- Repeated word
- Blank lines
- Markdown link
- Quoted string
- Domain name
- File extension
- Base64
- Trailing comma
Questions
Can I use this pattern in Python or Go?
Open "Use it in code" under the tool for a snippet in JavaScript, Python or Go. It converts syntax that differs, such as named groups and replacement references, and tells you when something won't work, like lookbehind in Go.
Why do I sometimes get a timeout error?
Some patterns take a very long time to fail. (a+)+b against a long string of a's with no b is a classic case, called catastrophic backtracking. Matching runs in a background thread with a time limit, so the page never freezes.
How are named groups shown?
A group written as (?<name>...) is shown with its name as well as its number. Naming a group doesn't change the numbers of the others.
Does Replace support $1 and named groups?
Yes, with the same syntax as JavaScript's String.replace(): $1, $2 for numbered groups, $<name> for named groups, $& for the whole match and $$ for a dollar sign.
Is my text or pattern sent anywhere?
No. Matching and replacing run in your browser.