Available in versions: Dev (3.21) | Latest (3.20) | 3.19 | 3.18 | 3.17 | 3.16 | 3.15 | 3.14 | 3.13 | 3.12 | 3.11
LIKE REGEX predicate
Applies to ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
Regular expression LIKE
predicates work like the LIKE predicate, but they match against a regular expression, not just simple LIKE
patterns.
TITLE LIKE_REGEX '.*abc.*' NOT (TITLE LIKE_REGEX '.*abc.*')
BOOK.TITLE.likeRegex(".*abc.*") BOOK.TITLE.notLikeRegex(".*abc.*")
Dialect support
This example using jOOQ:
BOOK.TITLE.likeRegex(".*abc.*")
Translates to the following dialect specific expressions:
Aurora MySQL, Databricks, H2, MariaDB, MemSQL, MySQL, Sybase
BOOK.TITLE REGEXP '.*abc.*'
Aurora Postgres, CockroachDB, Postgres, YugabyteDB
(BOOK.TITLE ~ '.*abc.*')
HSQLDB
REGEXP_MATCHES(BOOK.TITLE, '.*abc.*')
Oracle, Snowflake, Vertica
REGEXP_LIKE(BOOK.TITLE, '.*abc.*')
ASE, Access, BigQuery, ClickHouse, DB2, Derby, DuckDB, Exasol, Firebird, Hana, Informix, Redshift, SQLDataWarehouse, SQLServer, SQLite, Teradata, Trino
/* UNSUPPORTED */
Generated with jOOQ 3.21. Translate your own SQL on our website
Feedback
Do you have any feedback about this page? We'd love to hear it!