Regex Tester

Test and Validate Regular Expression Patterns with Live Results

Test your regular expressions in real-time with instant feedback. Features syntax highlighting, match visualization, and detailed pattern explanations.

Input

Result

Try These Examples

Email Validation

Validate email addresses

Regex Pattern:

^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$

Sample Text:

user@example.com
invalid-email
test.email+tag@domain.co.uk
@invalid.com
user@
valid@test.org

Phone Number Extraction

Extract US phone numbers

Regex Pattern:

\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})

Sample Text:

Call me at (123) 456-7890
Or reach me at 987-654-3210
Also try 555.123.4567
Invalid: 12-345-6789

URL Matching

Match HTTP/HTTPS URLs

Regex Pattern:

https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)

Sample Text:

Visit https://www.example.com
Or check http://test.org/path?query=1
Also see https://subdomain.site.co.uk/page
Not a URL: www.incomplete

Date Extraction (MM/DD/YYYY)

Extract dates in MM/DD/YYYY format

Regex Pattern:

(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/(19|20)\d{2}

Sample Text:

Born on 03/15/1990
Graduated 12/25/2010
Started work 01/01/2020
Invalid: 13/45/2021
Also invalid: 02/30/2020

Password Strength

Check password contains uppercase, lowercase, digit, and special char

Regex Pattern:

^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$

Sample Text:

Password123!
weakpass
STRONG123
GoodPass1
Excellent@Pass123
short1A!

HTML Tag Removal

Remove HTML tags from text

Regex Pattern:

<[^>]*>

Sample Text:

<p>This is a paragraph</p>
<div class='container'>Content here</div>
<br/>
<img src='image.jpg' alt='test'>
Plain text without tags

What is Regex?

A regular expression (regex or regexp) is a sequence of characters that define a search pattern. It is mainly used for string pattern matching or pattern matching, etc.

They can be used to search, edit, or manipulate text and data. Regular expressions are widely used in programming languages, text editors, and command-line tools for pattern matching and text processing.

Common Use Cases:

• Email validation and extraction

• Phone number formatting and validation

• Data cleaning and text preprocessing

• Log file analysis and parsing

• Search and replace operations

• Input validation in web forms