docs: Update the description of LIKE and ILIKE.
Add the description of what the valid patterns are and how they are
mathced.
Closes
@@ -31,14 +31,42 @@ elements and string slices can be produced by using ``[]``:
{'some text'}
-.. eql:operator:: LIKE: A LIKE B
+.. eql:operator:: LIKE: V LIKE P or V NOT LIKE P
- :optype A: str or bytes
- :optype B: str or bytes
+ :optype V: str or bytes
+ :optype P: str or bytes
:resulttype: bool
Case-sensitive simple string matching.
+ Returns ``true`` if the *value* ``V`` matches the *pattern* ``P``
+ and ``false`` otherwise. The operator :eql:op:`NOT LIKE<LIKE>` is
+ the negation of :eql:op:`LIKE`.
+
+ The pattern matching rules are as follows:
+
+ .. list-table::
+ :widths: auto
+ :header-rows: 1
+
+ * - pattern
+ - interpretation
+ * - ``%``
+ - matches zero or more characters
+ * - ``_``
+ - matches exactly one character
+ * - ``\%``
+ - matches a literal "%"
+ * - ``\_``
+ - matches a literal "_"
+ * - any other character
+ - matches itself
+
+ In particular, this means that if there are no special symbols in
+ the *pattern*, the operators :eql:op:`LIKE` and :eql:op:`NOT
+ LIKE<LIKE>` work identical to :eql:op:`EQ` and :eql:op:`NEQ`,
+ respectively.
+
.. code-block:: edgeql-repl
db> SELECT 'abc' LIKE 'abc';
@@ -49,16 +77,22 @@ elements and string slices can be produced by using ``[]``:
{true}
db> SELECT 'abc' LIKE 'c';
{false}
+ db> SELECT 'a%%c' NOT LIKE 'a\%c';
+ {true}
-.. eql:operator:: ILIKE: A ILIKE B
+.. eql:operator:: ILIKE: V ILIKE P or V NOT ILIKE P
- :optype A: str or bytes
- :optype B: str or bytes
+ :optype V: str or bytes
+ :optype P: str or bytes
:resulttype: bool
Case-insensitive simple string matching.
+ The operators :eql:op:`ILIKE` and :eql:op:`NOT ILIKE<ILIKE>` work
+ the same way as :eql:op:`LIKE` and :eql:op:`NOT LIKE<LIKE>`,
+ except that the *pattern* is matched in a case-insensitive manner.
+
.. code-block:: edgeql-repl
db> SELECT 'Abc' ILIKE 'a%';
