Skip to content

Commit e53ecc3

Browse files
authored
[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.
1 parent 1cbc10a commit e53ecc3

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/reference/query-dsl/regexp-syntax.asciidoc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ of `COMPLEMENT|INTERVAL` enables the `COMPLEMENT` and `INTERVAL` operators.
168168
`ALL` (Default)::
169169
Enables all optional operators.
170170

171+
`""` (empty string)::
172+
Alias for the `ALL` value.
173+
171174
`COMPLEMENT`::
172175
+
173176
--
@@ -179,6 +182,21 @@ a~bc # matches 'adc' and 'aec' but not 'abc'
179182
....
180183
--
181184

185+
`EMPTY`::
186+
+
187+
--
188+
Enables the `#` (empty language) operator. The `#` operator doesn't match any
189+
string, not even an empty string.
190+
191+
If you create regular expressions by programmatically combining values, you can
192+
pass `#` to specify "no string." This lets you avoid accidentally matching empty
193+
strings or other unwanted strings. For example:
194+
195+
....
196+
#|abc # matches 'abc' but nothing else, not even an empty string
197+
....
198+
--
199+
182200
`INTERVAL`::
183201
+
184202
--
@@ -216,6 +234,9 @@ You can combine the `@` operator with `&` and `~` operators to create an
216234
....
217235
--
218236

237+
`NONE`::
238+
Disables all optional operators.
239+
219240
[discrete]
220241
[[regexp-unsupported-operators]]
221242
=== Unsupported operators

0 commit comments

Comments
 (0)