---
title: "RE2 regex tester for Google Sheets"
description: "Free regex tester that uses RE2, the engine of Google Sheets, not JavaScript. See what REGEXMATCH, REGEXEXTRACT and REGEXREPLACE return for each cell and copy the formulas. Runs in your browser."
lang: en
canonical: https://goingstellar.ro/tools/re2-regex-tester/
type: free web tool
price: 0
publisher: GOING STELLAR S.R.L.
alternate_ro: https://goingstellar.ro/ro/unelte/tester-regex-re2/
---

> Use the tool (runs in your browser, nothing is uploaded): <https://goingstellar.ro/tools/re2-regex-tester/>

# RE2 regex tester for Google Sheets

Test a regular expression with RE2, the engine Google Sheets uses for REGEXMATCH, REGEXEXTRACT and REGEXREPLACE, not with your browser's JavaScript engine. Paste a column of cells, see what each formula returns for every cell, and copy the formulas ready for your sheet. If the expression uses something RE2 does not have, such as lookahead, the tester says what to write instead. It runs in your browser.

Valid RE2 expression · 3 capture groups.

| Cell | Text (matches highlighted) | REGEXMATCH | REGEXEXTRACT | REGEXREPLACE |
|---|---|---|---|---|
| A2 | 2026-11-29 | TRUE | 20261129 | 29.11.2026 |
| A3 | Invoice due 2026-12-15 | TRUE | 20261215 | Invoice due 15.12.2026 |
| A4 | 29/11/2026 | FALSE | no match | 29/11/2026 |

### The formulas for Google Sheets

- Does the cell match?`=REGEXMATCH(A2,"(\d{4})-(\d{2})-(\d{2})")`
- First match (one column per group)`=REGEXEXTRACT(A2,"(\d{4})-(\d{2})-(\d{2})")`
- Replace every match`=REGEXREPLACE(A2,"(\d{4})-(\d{2})-(\d{2})","$3.$2.$1")`

## Why test with RE2

- Google's help pages for REGEXMATCH, REGEXEXTRACT and REGEXREPLACE say: “Google products use RE2 for regular expressions. Google Sheets supports RE2 except Unicode character class matching.” (read on 29 November 2026). Most online testers run your browser's JavaScript engine, which accepts things RE2 does not, so an expression that works there can fail in a sheet.
- The RE2 syntax page marks as **not supported**: lookahead `(?=…)` `(?!…)`, lookbehind `(?<=…)` `(?<!…)`, backreferences `\1`, possessive quantifiers `*+`, atomic groups `(?>…)`, comments `(?#…)` and `\Z`. The tester recognises these and suggests what to write instead.
- Flags go inside the expression: `(?i)` ignores case, `(?m)` makes `^` and `$` match at every line, `(?s)` lets `.` match a line break. Named groups are written `(?P<name>…)`.

## What each Sheets function returns

- **REGEXMATCH(text, regular_expression)** returns TRUE or FALSE: whether a piece of text matches the expression.
- **REGEXEXTRACT(text, regular_expression)** returns the first matching part. Google's page says that with capture groups it returns one column per group, and without groups the whole match. The tester shows the columns side by side.
- **REGEXREPLACE(text, regular_expression, replacement)** replaces every match. The tester uses `$1` to `$9` for groups and `$0` for the whole match; Google's help page does not describe group references, so check a group replacement on one cell before you fill a column.
- All three work only with text. Google's pages say to convert numbers with the TEXT function first.

## How the tester works

The engine is re2js 2.9.1 (MIT licence), a JavaScript port of RE2, loaded from this site. It does not backtrack, so even a pathological expression finishes in time proportional to the text.

Before publishing we compared it with the original C++ RE2 library on 732 expressions and 9,321 cells: which expressions compile, REGEXMATCH, REGEXEXTRACT and every replacement. There were no differences except two the C++ library accepts and the tester rejects: `\C` (a single byte) and two groups with the same name.

Replacements follow RE2's global replace: after a match the search continues from its end, and an empty match right at the end of the previous one is skipped.

Need the days between two dates in a sheet? Use the [days between dates calculator](https://goingstellar.ro/tools/days-between-dates/).

In our Google Sheets function reference: [REGEXMATCH](https://goingstellar.ro/reference/sheets/regexmatch/) · [REGEXEXTRACT](https://goingstellar.ro/reference/sheets/regexextract/) · [all functions](https://goingstellar.ro/reference/sheets/).

## Questions and answers

**Why does my regex work on another tester but not in Google Sheets?**

Most testers use the JavaScript or PCRE engine. Google Sheets uses RE2, which has no lookahead, lookbehind or backreferences. Paste the expression here: if RE2 rejects it, the tester shows the error and what to use instead.

**How do I make REGEXMATCH ignore case?**

Put (?i) at the start of the expression, for example =REGEXMATCH(A2,"(?i)invoice"). The “Ignore case” box here adds it for you.

**How do I get several values out of one cell?**

Use capture groups in REGEXEXTRACT. Each group in parentheses becomes its own column. Use (?:…) for a group you do not want returned.

**Can I use \p{L} for letters with diacritics?**

RE2 has Unicode classes, but Google's help pages say Sheets does not support Unicode character class matching. List the letters in a class instead, for example [a-zA-ZăâîșțĂÂÎȘȚ].

**Is my text sent anywhere?**

No. The expression and the cells are processed in your browser. The page keeps your last expression and cells in this browser only.

## Sources

[Google: REGEXMATCH](https://support.google.com/docs/answer/3098292) · [Google: REGEXEXTRACT](https://support.google.com/docs/answer/3098244) · [Google: REGEXREPLACE](https://support.google.com/docs/answer/3098245) · [RE2 syntax](https://github.com/google/re2/wiki/Syntax) · [re2js](https://github.com/le0pard/re2js)

Pages read on 29 November 2026.

re2js © 2023 Oleksii Vasyliev, MIT licence: [licence text](https://goingstellar.ro/tools/re2-regex-tester/assets/licenses/re2js-LICENSE.txt).
