Regex Tester & Reference
Test regular expressions with live match highlighting and capture groups
Matches Highlighted
No matchesExample Patterns
Quick Reference
. Any character\d Digit (0-9)\w Word character\s Whitespace^ Start of line$ End of line* 0 or more+ 1 or more? 0 or 1{n} Exactly n times[abc] Character class(x) Capture groupDiscover another handy tool from EditPDF.pro
Character Classes
\d Digit [0-9]\D Non-digit\w Word [A-Za-z0-9_]\W Non-word\s Whitespace\S Non-whitespaceQuantifiers
* 0 or more+ 1 or more? 0 or 1{n} Exactly n{n,} n or more{n,m} Between n and mAnchors & Boundaries
^ Start of string/line$ End of string/line\b Word boundary\B Non-word boundaryGroups
(abc) Capture group(?:abc) Non-capturing group\1 Backreference to group 1(?<name>abc) Named capture groupLookaheads & Lookbehinds
(?=...) Positive lookahead(?!...) Negative lookahead(?<=...) Positive lookbehind(?<!...) Negative lookbehind