REGEXREPLACE in Google Sheets

Replaces every part of a text that matches a pattern with new text.

Syntax

REGEXREPLACE(text, regular_expression, replacement)
text
The text to search. It must be text; a number gives #VALUE!.
regular_expression
The pattern in quotes, such as "\d+" for one or more digits.
replacement
The text to put in its place. "" deletes what matches.

Examples

C1=REGEXREPLACE(A2,"\D","")
ABC
1Phone02079460018
2Tel: 020 7946 0018

In plain words: In the phone number in A2, replace everything that is not a digit with nothing.

C1=REGEXREPLACE(A2,"\s+"," ")
ABC
1NameAnn Berg
2Ann Berg

Practice REGEXREPLACE

Related functions