changeset 1338:76bdeccacb4d

add user docs for regex searching
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 21 Apr 2012 21:47:23 +0200
parents 3b1de2b38587
children 860ef379fc9e
files docs/user/search.rst
diffstat 1 files changed, 34 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/docs/user/search.rst	Sat Apr 21 20:52:12 2012 +0200
+++ b/docs/user/search.rst	Sat Apr 21 21:47:23 2012 +0200
@@ -76,6 +76,38 @@
 
   clean*
 
+Using regular expressions
+=========================
+
+Regular expressions enable even more flexibility for specifying search terms.
+
+See http://en.wikipedia.org/wiki/Regular_expression for basics about regexes.
+
+See http://docs.python.org/library/re.html about python's regex implementation,
+which we use for MoinMoin.
+
+You need to use this syntax when entering regexes: r"yourregex"
+
+Examples
+--------
+Search for hello or hallo::
+
+  r"h[ae]llo"
+
+Search for words starting with foo::
+
+  r"^foo"
+  r"\Afoo"
+
+Search for something like wiki, wika, wikb, ...::
+
+  r"wik."
+
+Search for something like wiki, willi, wi, ...::
+
+  r"w.*i"
+
+
 Searching in specific fields
 ============================
 
@@ -140,14 +172,14 @@
 
  * By using an index, the search is rather usually fast 
  * Because it is only using an index, it can only find what was put there
- * If you use wildcards, it will still use the index, but in a different, slower way
+ * If you use wildcards or regexes, it will still use the index, but in a different, slower way
 
 E.g.:
 
  * "foobar" is put into the index somehow
  * you search for "ooba" - you will not find it, because only "foobar" was put into the index
  * solution: search for "foobar" - fast and will find it
- * solution: search for "*ooba*" - slow, but will find it
+ * solution: search for "*ooba*" or r".*ooba.*" - slow, but will find it
 
 More infos
 ==========