Regex Tester
Test regular expressions against sample text, with live match highlighting and group capture details.
Runs in your browser. Your input stays on this device.
Regex quick reference
Anchors
^Start of string (or line with m flag)$End of string (or line with m flag)\bWord boundary (between a word char and a non-word char)Character shortcuts
.Any character except newline (enable s flag to include newline)\dDigit — same as [0-9]\wWord character — same as [a-zA-Z0-9_]\sWhitespace — space, tab, newline\D \W \SThe opposite of the above (non-digit, non-word, non-space)Quantifiers (how many times)
*Zero or more+One or more?Zero or one (makes the preceding part optional){3}Exactly 3 times{2,5}Between 2 and 5 timesGroups and sets
(abc)Capture group — the matched text appears in the Groups section(?:abc)Non-capturing group — groups without capturing[abc]Character set — matches a, b, or c[^abc]Negated set — matches anything except a, b, or c[a-z]Range — matches any lowercase letter a through za|bAlternation — matches a or bFlags (checkboxes above)
gGlobal — find all matches, not just the firstiCase insensitive — FOO matches foomMultiline — ^ and $ match start/end of each linesDot-all — makes . match newlines tooExample patterns to try
\d+One or more digits\b\w+\bEach whole word[A-Z][a-z]+Capitalized words\w+@\w+\.\w+Simple email-like addresseshttps?://\S+URLs starting with http or httpsCommon questions
Quick answers before you use this tool.
Runs in your browser. Your input stays on this device.
No account is required. Open the tool and use it right away.
Yes. Enable the global flag (g) to find every match in the test string, with each match shown individually in the results list.