Google Sheets
REGEXREPLACE function in Google Sheets
Replaces part of a text string with a different text string using regular expressions.
=REGEXREPLACE(text, regular_expression, replacement)REGEXREPLACE syntax and parameters
Three arguments, three required.
- textstringRequired
The text, a part of which will be replaced.
- regular_expressionstringRequired
The regular expression. All matching instances in text will be replaced.
- replacementstringRequired
The text which will be inserted into the original text.
REGEXREPLACE examples
Formulas you'll actually reuse.
Keep only the digits of a phone number:
=REGEXREPLACE(A2, "[^0-9]", "")Result
"4915112345678"Reorder an ISO date into DD.MM.YYYY with capture groups ($1…):
=REGEXREPLACE(A2, "(\d{4})-(\d{2})-(\d{2})", "$3.$2.$1")Result
"14.08.2026"
REGEXREPLACE in Excel
Same name — your formula ports as-is.
Try REGEXREPLACE in the playground
Edit the example — nothing to install.
Preloaded with the REGEXREPLACE formula from Example 1 — change anything and watch it respond.
Loading the editor…
Related functions
More ways Google Sheets gets this done.
- ARABICComputes the value of a Roman numeral.TextExcel
- CHARConvert a number into a character according to the current Unicode table.TextExcel
- CLEANReturns the text with the non-printable ASCII characters removed.TextExcel
- CODEReturns the numeric Unicode map value of the first character in the string provided.TextExcel
- CONCATENATEAppends strings to one another.TextExcel
- DOLLARFormats a number into the locale-specific currency format.TextExcel