H2 not recognising regexp_like

database, h2, java, jdbc, regex

Solution

See the excellent documentation.

col REGEXP '[^[:alpha:]]'

In general SQL variants either use a function or named operator.

Whether the above specific regex works I do not know. One should be able to rely on java regular expressions.

Problem

I have a query written to run on an Oracle database which uses the function REGEXP_LIKE to filter some rows from the query. The specific function call is ``` regexp_like(col1, '[^[:alpha:]]') ``` The problem is when I run the query on H2 I get the following error: ``` org.h2.jdbc.JdbcSQLException: Function "REGEXP_LIKE" not found ``` If I run the query directly on the Oracle database using the SQLDeveloper tool it returns as expected. Any ideas what could be causing this?

Original source