REGEXP_LIKE Operator

The REGEXP_LIKE operator returns true if the string matches the regular expression. This function is similar to the LIKE predicate, except that it uses regular expressions rather than simple wildcard character matching.

Syntax

REGEXP_LIKE( sourceString, patternString )

sourceString

The character expression to match against the regular expression.

patternString

The regular expression string used to search for a match in sourceString.

The pattern is a java.util.regex pattern. You can find documentation for the JDK 8 version here: http://docs.oracle.com/javase/8/docs/api/java/util/regex/package-summary.html.

Results

Returns true if the sourcestring you are testing matches the specified regular expression in patternString.

Examples

The following query finds all players whose name begins with Ste:

splice> SELECT DisplayName
   FROM Players
   WHERE REGEXP_LIKE(DisplayName, '^Ste.*');

DISPLAYNAME
------------------------
Steve Raster
Steve Mossely
Stephen Tuvesco

3 rows selected

See Also