Regex Tester
Test regular expressions online — enter a pattern and flags, paste your test string, and instantly see all matches highlighted.
Matches
Quick reference
. Any character \d Digit [0-9] \w Word char [a-zA-Z0-9_] \s Whitespace ^ Start of string $ End of string * Zero or more + One or more ? Zero or one {n,m} Between n and m (abc) Capture group a|b a or b [abc] Character class [^abc] Negated class \b Word boundary g global i case-insensitive m multiline s dot-allRegex Tester Online
Enter a regular expression pattern and test string to instantly see all matches highlighted. The match list shows each match with its index position. Everything runs in your browser — no server involved.
How to use this tool
- Type your regex pattern in the pattern field (without the surrounding slashes).
- Add any flags in the flags field —
gfor global (find all matches),ifor case-insensitive,mfor multiline. - Paste or type the text you want to test in the test string area.
- Matches are highlighted and listed instantly.
Common regex patterns
- Email:
\b[\w.+-]+@[\w-]+\.[a-z]{2,}\b - URL:
https?://[^\s]+ - IPv4:
\b\d{1,3}(\.\d{1,3}){3}\b - Digits only:
^\d+$ - Phone (UK):
(\+44|0)[\d\s]{9,10}
Frequently Asked Questions
What is a regular expression?
How do I test a regex pattern?
What regex flags are supported?
What are some common regex patterns?
^\d+$ (numbers only), ^[a-zA-Z0-9]+$ (alphanumeric), \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b (email), https?://\S+ (URLs), \d{4}-\d{2}-\d{2} (dates like 2024-01-15).Why isn't my regex working?
., *, or + when you mean them literally; incorrect character classes; missing flags like i for case-insensitive matching; or using features not supported by your target regex flavor.