TRANSLATE_REGEX

TRANSLATE_REGEX is a function in SQL. It allows the substitution of a character pattern with another character pattern using regular expressions in the source string of text and returns the result.

Example

SELECT
TRANSLATE_REGEX('hello 123 world', '[0-9]+') AS result
FROM dual;

Output

"hello world"

Explanation

In the above example, TRANSLATE_REGEX function is used on the string ‘hello 123 world’ by providing the pattern ‘[0-9]+’, which represents one or more digits. This function removes all matches of the provided pattern from the original string, thus resulting in ‘hello world’.

For in-depth explanations and examples SQL keywords where you write your SQL, install our extension.