Pattern matching for text—the Swiss Army knife of data cleaning
Regular expressions (regex) are patterns used to match character combinations in text. They're essential for finding, extracting, and replacing text patterns—from email addresses to phone numbers to complex data formats.
Type a pattern below and watch matches highlight in real time!
This pattern matches email addresses.
By default, quantifiers are greedy (match as much as possible). Add ? after to make lazy: .*? matches as little as possible.
Characters like . * + ? [ ] ( ) { } | \ ^ $ have special meanings. Use \ to match them literally: \. matches a period.
[abc] matches a, b, or c. [a-z] matches any lowercase letter. [^abc] matches anything except a, b, c.
Parentheses () create groups you can reference later. In (\d{3})-(\d{4}), group 1 is area code, group 2 is number.