Functions and Parameters

The following syntax shows the function parameters for Oracle’s regular expression functions. The meaning of the parameters is shown in Regular Expression Parameters.

Regular Expression Functions

The syntax for each regular expression function is shown below.

REGEXP_COUNT (Oracle Database 11g Only)

Returns a tally of occurrences of an expression in a target string. The syntax is:

REGEXP_COUNT(source_string, expression
             [, position
             [, match_parameter]]

REGEXP_INSTR

Returns the character position at which text can be found matching a regular expression in a target string. The syntax is:

REGEXP_INSTR(source_string, expression
             [, position [, occurrence
             [, return_option
             [, match_parameter
             [, subexpression]]]]])

REGEXP_LIKE

Determines whether a given string contains text matching an expression. This is a Boolean function, returning TRUE, FALSE, or NULL. The syntax is:

REGEXP_LIKE (source_string, expression
             [, match_parameter])

REGEXP_REPLACE

Performs a regular expression search-and-replace operation (see Chapter 8 for details). The syntax is:

REGEXP_REPLACE(source_string, expression
             [, replace_string
             [, position [, occurrence
             [, match_parameter]]]]

REGEXP_SUBSTR

Extracts text matching a regular expression from a string. The syntax is:

REGEXP_SUBSTR(source_string, expression
             [, position [, occurrence
             [, match_parameter
             [, subexpression]]]]

Regular Expression Parameters

These are the parameters that may be included in the regular expression functions described above.

source_string

Get Oracle PL/SQL Programming, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.