This function is a major upgrade to Excel’s rather primitive text functions.

Note that REGEXREPLACE is case-sensitive by default.

With this pattern, REGEXREPLACE will replace any character that is not a digit with an empty string.

REGEXREPLACE example - strip non-numeric characters

The final result contains digits only.

means any single character.

The parentheses () define a capturing group.

REGEXREPLACE example - strip non-numeric characters

The full pattern “^(.)”

captures any single character at the beginning of the text in a group.

This formula will work for 10-digit phone numbers.

REGEXREPLACE example - strip non-numeric characters

If you oughta handle different lengths or formats, you will need to adjust the regular expression accordingly.

Excel makes it easy to combine these two formulas together by nesting the first REGEXREPLACE inside the second.

Regex terminology

Because Regex is essentially a mini-language, it has its own vocabulary.

REGEXREPLACE example - strip non-numeric characters

By default, REGEXEXTRACT will return the first match, but…

REGEXREPLACE example - strip non-numeric characters

REGEXREPLACE example - capitalize first letter

REGEXREPLACE example - capitalize specific words

REGEXREPLACE example -  format telephone numbers

Combining multiple REGEXREPLACE functions together

Excel formula: Strip non-numeric characters

Excel REGEXTEST function

Excel REGEXEXTRACT function

REGEXREPLACE example - strip non-numeric characters

REGEXREPLACE example - capitalize first letter

REGEXREPLACE example - capitalize specific words

REGEXREPLACE example -  format telephone numbers

Combining multiple REGEXREPLACE functions together