Regex Tester

Live regex matching with groups and replacement

Use $1, $2 for capture groups, $0 for the full match.

Quick Reference

. Any character
\d Digit [0-9]
\w Word char [a-zA-Z0-9_]
\s Whitespace
\b Word boundary
^ Start of string/line
$ End of string/line
* 0 or more
+ 1 or more
? 0 or 1
{n,m} Between n and m
[abc] Character class
[^abc] Negated class
(group) Capture group
(?:group) Non-capturing
a|b Alternation
(?=x) Lookahead
(?<=x) Lookbehind

What are Regular Expressions?

Regular expressions (regex) are pattern-matching strings supported by virtually every programming language. They're used for validation, search-and-replace, parsing logs, and extracting data from text.