瀏覽代碼

Corrected regexp syntax docs for COMPLEMENT

Clinton Gormley 9 年之前
父節點
當前提交
c3cd8564df
共有 1 個文件被更改,包括 12 次插入4 次删除
  1. 12 4
      docs/reference/query-dsl/regexp-syntax.asciidoc

+ 12 - 4
docs/reference/query-dsl/regexp-syntax.asciidoc

@@ -220,12 +220,20 @@ Complement::
 --
 
 The complement is probably the most useful option. The shortest pattern that
-follows a tilde `"~"` is negated.  For the string `"abcdef"`:
+follows a tilde `"~"` is negated.  For instance, `"ab~cd" means:
+
+* Starts with `a`
+* Followed by `b`
+* Followed by a string of any length that it anything but `c`
+* Ends with `d`
+
+For the string `"abcdef"`:
 
     ab~df     # match
-    ab~cf     # no match
-    a~(cd)f   # match
-    a~(bc)f   # no match
+    ab~cf     # match
+    ab~cdef   # no match
+    a~(cb)def # match
+    a~(bc)def # no match
 
 Enabled with the `COMPLEMENT` or `ALL` flags.