Regex Tester

Test and debug regular expressions with live match highlighting.

Regex Tester

Test and debug regular expressions with live match highlighting

/ /
Enter a regex pattern and test string above.
Replace with
Result
Matches will appear here once your regex finds something.
Common Patterns
Quick Reference
.Any character (except newline)
\dDigit [0-9]
\DNon-digit
\wWord char [a-zA-Z0-9_]
\WNon-word character
\sWhitespace (space, tab...)
\SNon-whitespace
\nNewline
\tTab
[abc]Character class a, b, or c
[^abc]Not a, b, or c
[a-z]Range a through z
*0 or more (greedy)
+1 or more (greedy)
?0 or 1 (optional)
{n}Exactly n times
{n,}n or more times
{n,m}Between n and m times
*?0 or more (lazy)
+?1 or more (lazy)
^Start of string / line
$End of string / line
\bWord boundary
\BNon-word boundary
a|ba or b (alternation)
(abc)Capture group
(?:abc)Non-capture group
(?=abc)Positive lookahead
(?!abc)Negative lookahead
(?<=abc)Positive lookbehind
(?<!abc)Negative lookbehind
\1Backreference to group 1
$1Group 1 in replacement
Copied!

The Regex Tester lets you build and check regular expressions with live results. Type a pattern and some sample text to see the matches highlighted right away, which makes learning and debugging regex much easier.

How to test a regular expression

  1. Enter your regex pattern.
  2. Paste the text you want to test against.
  3. See the matches highlighted live.
  4. Adjust the pattern until it works.

Why test regex live

Regular expressions are powerful but easy to get wrong. Seeing the matches as you type helps you understand what your pattern catches and what it misses, so you can fix it without endless trial in your code.

Great for learning

Beginners can experiment safely and watch how small changes affect the matches. Experienced developers use it to confirm a tricky pattern before they drop it into a project. Either way, it saves time.