regexp_like() function

The regexp_like() function returns t if there is at least one matching occurrence in the input.

Syntax

The regexp_like() function has the following syntax:
bool = regexp_like(varchar input, varchar pattern [, int start_pos] [, 
varchar flags]);
bool = regexp_like(nvarchar input, varchar pattern, varchar flags);
bool = regexp_like(nvarchar input, nvarchar pattern [, int start_pos] 
[, varchar flags]);

The input value specifies the varchar or nvarchar value against which the regular expression is processed.

The pattern value specifies the regular expression. For a description of how to specify Perl compatible regular expression (PCRE) patterns for Unicode data, see any general PCRE documentation or web sources.

The start_pos value specifies the character position at which to start the search for a match. The default is 1.

For a description of the flags value, see flags argument.

Returns

The function returns t if there is at least one matching occurrence in the input and f if there is no match.

Example

select regexp_like('my password is 09124 or 
069az6','[0-9][^0-9]+[0-9]$');
 REGEXP_LIKE
-------------
 t
(1 row)