Regex Tester

Live match highlighting · Group captures · Flags · Cheatsheet

/ /
Enter a pattern and test string to see matches
Test String
Quick Reference
Anchors
^ Start of string/line
$ End of string/line
\b Word boundary
Character Classes
\d Digit [0-9]
\w Word char [a-zA-Z0-9_]
\s Whitespace
. Any char (except newline)
[abc] a, b, or c
[^abc] Not a, b, or c
Quantifiers
* 0 or more
+ 1 or more
? 0 or 1
{n} Exactly n
{n,m} Between n and m
Groups
(abc) Capture group
(?:abc) Non-capture group
(?=abc) Lookahead
(?!abc) Negative lookahead
Common Patterns
Email
URL
IPv4
Date (YYYY-MM-DD)
Phone (Indian)
Hex Color

About the Regex Tester

This tool tests JavaScript-compatible regular expressions in real time. All matches are highlighted in the test string, and capture groups are displayed separately. The cheatsheet on the right covers the most commonly used regex syntax.