REPLACE_ALL

Description

Returns a new string in which all occurrences matching the provided regular expression (regex) within the original string are replaced by the specified replacement substring.

Syntax

REPLACE_ALL(string, regex, replacement) -> String

Parameters

ParameterData TypeRequiredDescription
stringStringYesThe original string.
regexStringYesThe regular expression defining patterns to replace.
replacementStringYesThe substring used to replace matched patterns.

Example

REPLACE_ALL(
	"The user logged in at 10:00 and logged out at 17:00.",
	"\b(?:[01]?\d|2[0-3]):[0-5]\d\b",
	"[TIME]"
)
-- Returns "The user logged in at [TIME] and logged out at [TIME]."