Excel REGEX Generator & Tester
Test a regular expression against your own text and get ready-to-paste REGEXEXTRACT, REGEXREPLACE, and REGEXTEST formulas for Excel and Google Sheets. Everything runs in your browser.
2 matches
Contact: «jane@example.com» or «sales@acme.co». Order #12345 on 2026-07-09.
- jane@example.com
- sales@acme.co
Generate the Excel formula
=REGEXEXTRACT(A2, "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}")Keep only rows that match, in one formula:
=FILTER(A:A, REGEXTEST(A:A, "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}"))Using Regular Expressions in Excel
Since 2024, Microsoft 365 includes three native regex functions, so you no longer need nested LEFT/MID/FIND formulas or VBA to pull structured text out of a cell:
- REGEXTEST(text, pattern) - returns TRUE or FALSE. Use it to flag rows, in conditional formatting, or inside IF and FILTER.
- REGEXEXTRACT(text, pattern) - returns the first match. Pull an email, an order number, or a date out of a messy cell.
- REGEXREPLACE(text, pattern, replacement) - swap every match for new text. Strip characters, reformat, or clean data in one pass.
Build and test your pattern above, copy the generated formula, and paste it into Excel. Because the tester uses your browser's own regex engine, the matches you see are exactly what the pattern will find.
Does It Work in Google Sheets?
Yes. The pattern syntax is shared, so any pattern here works in Google Sheets too. Sheets uses REGEXMATCH instead of REGEXTEST; the REGEXEXTRACT and REGEXREPLACE names are identical.
Common Patterns
The preset buttons above load ready-made patterns for emails, URLs, phone numbers, prices, dates, and ZIP codes. Click one, then adjust it against your own sample text until the matches look right.
Frequently Asked Questions
Yes. In 2024 Microsoft added native REGEX functions to Excel for Microsoft 365 - REGEXTEST, REGEXEXTRACT, and REGEXREPLACE. This tool generates those formulas and also lets you test a pattern against your own text first. Google Sheets has had REGEXEXTRACT, REGEXREPLACE, and REGEXMATCH for years.
Yes, completely free with no signup. The pattern is tested in your browser using the same regular-expression engine your browser uses, so nothing you type is sent to a server.
That means your Excel version doesn't have the REGEX functions yet - they require Microsoft 365 (2024 or later). In older Excel, use Google Sheets (REGEXEXTRACT / REGEXREPLACE / REGEXMATCH) or fall back to text functions like LEFT, MID, and SUBSTITUTE.
REGEXTEST returns TRUE/FALSE for whether a cell matches. REGEXEXTRACT pulls out the matching text (great for grabbing an email or number from a messy cell). REGEXREPLACE swaps matches for replacement text (great for cleaning data).
The pattern syntax is the same (both use the RE2/PCRE-style engine), so the patterns here work in both. The function names differ slightly: Excel uses REGEXTEST, Google Sheets uses REGEXMATCH, but the other two names match.