Oracle SQL - Regular Expression Function Syntax


The four regular expression functions have the following syntax.

You can specify regular expressions in their pattern argument.

REGEXP_LIKE(text, pattern[, options])
REGEXP_INSTR(text, pattern[, pos[, occurrence[, return[, options]]]])
REGEXP_SUBSTR(text, pattern[, pos[, occurrence[, options]]])
REGEXP_REPLACE(text, pattern[, replace [, pos[, occurrence[, options]]]])

For all four functions, the first two arguments (text and pattern) are mandatory.

These arguments provide the source text and the regular expression to search for, respectively.

All of the remaining arguments are optional.

In REGEXP_INSTR, REGEXP_SUBSTR, and REGEXP_REPLACE, you can use the pos argument to specify from which position in text you want the search to start (default to 1).

With occurrence, you can specify how often you want to find the search pattern (default is 1).

Related Topic