Last Updated: 2023-10-26
REGEXP_REPLACE (
expression, pattern, replacement, [position]
)
The REGEXP_REPLACE function replaces occurrences of a regular expression pattern in a string with a specified replacement string.
This function is part of the SERVERPAST extension. You must enable the extension before using this function.
SELECT REGEXP_REPLACE('My phone number is 123-456-7890', '[0-9]+', 'XXX', 1);
-- Result: My phone number is XXX-XXX-XXXX