Skip to content

Regex formula generator

Extract, match and replace text with regex

Describe what you need to find, like emails, order numbers or digits. Get the formula, the pattern explained token by token, and a live tester.

  • Pattern explained
  • Live tester
  • RE2 and PCRE aware

Try an example:

Spreadsheet app
Argument separator

Free: 25 requests a day, no sign-up

Cheat sheet

Regex building blocks

More free spreadsheet tools

Everything you need when a formula gets in the way.

Frequently asked questions

Which regex functions do Excel and Google Sheets have?

Google Sheets has REGEXMATCH, REGEXEXTRACT and REGEXREPLACE. Microsoft 365 Excel has REGEXTEST, REGEXEXTRACT and REGEXREPLACE. Excel 2021 and older have no regex functions, so the tool also gives a non-regex alternative when you choose an older version.

Why does my pattern work in Excel but not in Google Sheets?

Google Sheets uses the RE2 engine, which does not support lookaheads and lookbehinds such as (?=…). Excel uses PCRE2, which does. Choose your app and the generator only uses features that app supports.

Can I test the pattern before using it?

Yes. Each result includes a live tester. Edit the pattern or the sample text and see the matches highlighted instantly in your browser.

How do I make a match case-insensitive?

Start the pattern with (?i), for example (?i)invoice. In Excel 365 you can also set the case_sensitivity argument of REGEXTEST to 1.