DB2 Scalar functions - REGEXP_LIKE
The REGEXP_LIKE scalar function returns a boolean value indicating if the regular expression pattern is found in a string. The function can be used only where a predicate is supported.
The schema is SYSIBM.
If the string unit is specified as CODEUNITS16 or OCTETS, and if the string unit of the source string is CODEUNITS32, an error is returned (SQLSTATE 428GC).
For more information, see "String units in built-in functions" in Character strings.
The result of the function is a BOOLEAN value. If the pattern expression is found, the result is true. If the pattern expression is not found, the result is false. If the value of any of the arguments is null, the result is unknown.
SELECT EMPNO FROM EMPLOYEE WHERE REGEXP_LIKE(LASTNAME,'luc+?hes+?i','i')
SELECT PID FROM PRODUCT WHERE NOT REGEXP_LIKE(pid,'[0-9]{3}-[0-9]{3}-[0-9]{2}')