Skip to content

Commit 2edd43b

Browse files
committed
HHH-3404 document HQL REGEXP
1 parent 40bf38c commit 2edd43b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

documentation/src/main/asciidoc/querylanguage/Expressions.adoc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1495,7 +1495,7 @@ Their syntax is defined by:
14951495
include::{extrasdir}/predicate_like_bnf.txt[]
14961496
----
14971497

1498-
The expression on the right is a pattern, where:
1498+
The expression on the right is usually a SQL-style pattern, where:
14991499

15001500
* `_` matches any single character,
15011501
* `%` matches any number of characters, and
@@ -1509,6 +1509,14 @@ from Book where title not like '% for Dummies'
15091509

15101510
The optional `escape` character allows a pattern to include a literal `_` or `%` character.
15111511

1512+
Alternatively, the `regexp` keyword specifies that the pattern should be interpreted as a regular expression:
1513+
1514+
[[like-regexp-predicate-example]]
1515+
[source, hql]
1516+
----
1517+
from Book where title not like regexp '.+ for Dummies'
1518+
----
1519+
15121520
As you can guess, `not like` and `not ilike` are the enemies of `like` and `ilike`, and evaluate to the exact opposite boolean values.
15131521

15141522
[[in-predicate]]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
expression "NOT"? ("LIKE" | "ILIKE") expression ("ESCAPE" character)?
1+
expression "NOT"? ("LIKE" | "ILIKE") REGEXP? expression ("ESCAPE" character)?

0 commit comments

Comments
 (0)