Skip to main content
Workday User Guide
Last Updated: 2025-10-31
MS.REGEXREPLACE

MS.REGEXREPLACE

Description

Replaces text within a string with new text based on a regular expression pattern.
This function is useful for cleaning, reformatting, or anonymizing text data based on patterns.

Syntax

REGEXREPLACE(
text
,
pattern
,
replacement
, [
occurrence
], [
case_sensitivity
])
  • text
    : The text or cell reference containing the text you want to replace strings within.
  • pattern
    : The regular expression that defines the pattern of text you want to replace.
  • replacement
    : The text that will be inserted into the string to replace the matched pattern.
  • occurrence
    : The instance of the pattern you want to replace. The default is 0 which replaces all instances.
  • case_sensitivity
    : A number that determines whether the match is case-sensitive. Options include:
    • 0 (default): Case-sensitive.
    • 1: Case-insensitive.