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
| Parameter | Data Type | Required | Description |
|---|---|---|---|
| string | String | Yes | The original string. |
| regex | String | Yes | The regular expression defining patterns to replace. |
| replacement | String | Yes | The 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]."