Browse Source

[DOCS] Document missing `flag` values for `regexp` query (#82265)

Documents the `EMPTY` and `NONE` `flag` values for the `regexp` query.

Also documents the `""` (empty string) value, which is an alias for `ALL`.

Closes #81978.
James Rodewig 3 years ago
parent
commit
e53ecc3f43
1 changed files with 21 additions and 0 deletions
  1. 21 0
      docs/reference/query-dsl/regexp-syntax.asciidoc

+ 21 - 0
docs/reference/query-dsl/regexp-syntax.asciidoc

@@ -168,6 +168,9 @@ of `COMPLEMENT|INTERVAL` enables the `COMPLEMENT` and `INTERVAL` operators.
 `ALL` (Default)::
 Enables all optional operators.
 
+`""` (empty string)::
+Alias for the `ALL` value.
+
 `COMPLEMENT`::
 +
 --
@@ -179,6 +182,21 @@ a~bc   # matches 'adc' and 'aec' but not 'abc'
 ....
 --
 
+`EMPTY`::
++
+--
+Enables the `#` (empty language) operator. The `#` operator doesn't match any
+string, not even an empty string.
+
+If you create regular expressions by programmatically combining values, you can
+pass `#` to specify "no string." This lets you avoid accidentally matching empty
+strings or other unwanted strings. For example:
+
+....
+#|abc  # matches 'abc' but nothing else, not even an empty string
+....
+--
+
 `INTERVAL`::
 +
 --
@@ -216,6 +234,9 @@ You can combine the `@` operator with `&` and `~` operators to create an
 ....
 --
 
+`NONE`::
+Disables all optional operators.
+
 [discrete]
 [[regexp-unsupported-operators]]
 === Unsupported operators