Regex Tester

Build and test your regular expressions in real-time with instant match highlighting.

Regular Expression
Test String
Contact us at support@example.com or for sales, email sales@example.org. Invalid: user@.com
Match Information
#MatchIndex
No matches found.
Regex Cheat Sheet

Common Tokens

.

Any character except newline

\w

Any word character (a-z, A-Z, 0-9, _)

\W

Any non-word character

\d

Any digit (0-9)

\D

Any non-digit

\s

Any whitespace character

\S

Any non-whitespace character

Anchors

^

Start of the string

$

End of the string

\b

Word boundary

\B

Non-word boundary

Quantifiers

*

0 or more times

+

1 or more times

?

0 or 1 time

{n}

Exactly n times

{n,}

At least n times

{n,m}

Between n and m times

Groups & Ranges

(...)

Capture group

[abc]

Any of a, b, or c

[^abc]

Not a, b, or c

[a-z]

Any lowercase letter

What Are Regular Expressions (Regex)?

A regular expression (or regex) is a sequence of characters that specifies a search pattern. It's like a super-powered version of the "Find" command you use in a word processor. Developers use regex to validate user input (like checking if an email address is in a valid format), parse text, perform advanced find-and-replace operations, and much more.

How This Tool Helps

  • Instant Feedback: As you type your regex pattern, the tool immediately highlights all the matches in your test string, so you can see the effect of your changes in real-time.
  • Match Information: Get a clear list of all the matches found, including their index and any capture groups.
  • Error Highlighting: If your regex pattern contains an error, the tool will alert you so you can fix it quickly.
  • Built-in Cheat Sheet: Not sure how to match a specific character or group? The included cheat sheet provides a quick reference for the most common regex tokens.

Frequently Asked Questions (FAQs)