Free Online Regex Tester

Free
Utility

Test, validate, and debug regular expressions with real-time matching and detailed results.

(4.4) reviews
No signup required

Example Patterns

Choose from common regex patterns to test and learn

Regular Expression Pattern

Enter your regex pattern and select flags

Test String

Enter the text to test against the pattern

Matches

Found 0 matches

No matches found

Regular Expression Flags

Understanding regex flags and their usage

g(Global)

Matches all occurrences of the pattern in a string, not just the first one

Pattern: cat

Text: cat and cat

With flag: Matches both 'cat's

Without flag: Only matches first 'cat'

i(Case Insensitive)

Makes the pattern case-insensitive

Pattern: hello

Text: Hello HELLO hello

With flag: Matches all variations regardless of case

Without flag: Only matches exact 'hello'

m(Multiline)

^ and $ match the start/end of each line, not just the whole string

Pattern: ^start

Text: start start

With flag: Matches 'start' at beginning of each line

Without flag: Only matches 'start' at beginning of string

s(Dot All)

Dot (.) matches newline characters \n

Pattern: .*

Text: line1 line2

With flag: Matches entire text including newline

Without flag: Matches up to newline only

u(Unicode)

Enables Unicode support. Useful for non-ASCII characters and emoji

Pattern: \u{1F604}

Text: 😄 smile

With flag: Matches Unicode emoji

Without flag: No Unicode support

y(Sticky)

Matches only from the last index position

Pattern: \w+

Text: first second

With flag: Matches only from lastIndex

Without flag: Matches anywhere in string

Regex Cheatsheet

Quick reference for common regex patterns and usage

Character Classes

.

Any character except newline

Example: a, b, c, 1, @, etc.

\w

Word character

Example: a-z, A-Z, 0-9, _

\d

Digit

Example: 0-9

\s

Whitespace character

Example: space, tab, newline

\W

Not a word character

Example: @, #, $, etc.

\D

Not a digit

Example: anything except 0-9

\S

Not a whitespace character

Example: any visible character

Quantifiers

*

0 or more times

Example: ab* matches 'a', 'ab', 'abb', etc.

+

1 or more times

Example: ab+ matches 'ab', 'abb', but not 'a'

?

0 or 1 time

Example: ab? matches 'a' or 'ab'

{n}

Exactly n times

Example: a{3} matches 'aaa'

{n,}

n or more times

Example: a{2,} matches 'aa', 'aaa', etc.

{n,m}

Between n and m times

Example: a{2,4} matches 'aa', 'aaa', 'aaaa'

Anchors

^

Start of string/line

Example: ^hello matches 'hello world'

$

End of string/line

Example: world$ matches 'hello world'

\b

Word boundary

Example: \bcat\b matches 'cat' but not 'category'

\B

Not a word boundary

Example: \Bcat\B matches 'category' but not 'cat'

Groups & Assertions

(abc)

Capturing group

Example: (\w+)@(\w+\.\w+) captures username and domain

(?:abc)

Non-capturing group

Example: (?:https?://) matches protocol without capturing

a(?=b)

Positive lookahead

Example: a(?=b) matches 'a' only if followed by 'b'

a(?!b)

Negative lookahead

Example: a(?!b) matches 'a' only if not followed by 'b'

Common Patterns

Email
^[\w.-]+@([\w-]+\.)+[\w-]{2,}$

Basic email validation

URL
https?:\/\/[\w\d\-._~:/?#[\]@!$&'()*+,;=]+

Basic URL validation

Phone Number
\+?\d{1,4}?[-.\s]?\(?\d{1,3}?\)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}

International phone number

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

At least 8 characters, upper, lower, number, special

Features

Professional Features

Our Regex Tester tool provides comprehensive features for testing and debugging regular expressions.

Real-Time Testing

Test your regex patterns instantly with live highlighting of matches as you type.

Feature
Active

Regex Flags Support

Use standard regex flags (g, i, m, s, u, y) to modify pattern matching behavior.

Feature
Active

Match Details

View detailed information about matches, including indices and captured groups.

Feature
Active

Easy Export

Copy or download match results for further analysis or documentation.

Feature
Active

Match Navigation

Navigate through multiple matches easily with next/previous controls.

Feature
Active

Syntax Validation

Instant feedback on regex syntax errors to help debug patterns.

Feature
Active
6+
Features
99.9%
Reliability
24/7
Available
Free
Always

How to Use the Regex Tester

Simple 3-step process

Follow these easy steps to get started with Regex Tester and achieve your goals quickly.

1
Step 1

Enter your regular expression pattern in the pattern field and select appropriate flags (g, i, m, etc.).

Easy
2
Step 2

Type or paste your test text in the input area. Matches will be highlighted in real-time.

Easy
3
Step 3

View match details, navigate through matches, and use copy/download options for results.

Easy
Ready to start?
Tool is ready to use
Quick Start
Begin in seconds
Easy Process
No learning curve
Instant Results
Get results immediately

Frequently Asked Questions

5 questions answered

Find answers to commonly asked questions about our tools and services.

Still have questions?

Can't find what you're looking for? We're here to help you get the answers you need.

5+
Questions
24/7
Available
95%
Solved Rate
1min
Avg Response