Browse Source

Added regular expression example to advanced search tutorial.

Matt Lundin 9 years ago
parent
commit
db14fdf499
1 changed files with 21 additions and 17 deletions
  1. 21 17
      org-tutorials/advanced-searching.org

+ 21 - 17
org-tutorials/advanced-searching.org

@@ -236,31 +236,35 @@ more strongly than "or" (=|=). For instance, the following search...
 There, are, however several other ways to achieve the grouping effect
 of parentheses:
 
-1. Use a slightly more verbose query as a substitute for the logic of
-   parentheses. E.g.,
+1. Use a regular expression
 
-   : computer&email|work&email
+   To invoke the "grouping" logic of parentheses, you can construct a
+   regular expression:
 
-   This search will match all headlines tagged either with "computer"
-   and "email" or with "work" and "email." 
+   : +{computer\|work}+email
 
-2. Use [[http://orgmode.org/manual/Agenda-commands.html#Agenda-commands][agenda filtering]].
+   Note: you can also use the special property =ALLTAGS= (which
+   queries the same data as a normal tags search) together with a
+   regular expression:
 
-   This is perhaps the most practical option. Simply search for all
-   headlines tagged with "computer" or "work" and then use the
-   agenda's tag filtering capabilities (=/=) to see only those
-   headlines among the results that have the tag "email."
+   : ALLTAGS={computer\|work}+email
+   
+   (In the next section we'll learn more about how property searches
+   and regular expressions are constructed.)
 
-3. Use a property search with regular expressions.
+2. Use a slightly more verbose query as a substitute for the logic of
+   parentheses. E.g.,
 
-   To invoke the "grouping" logic of parentheses, you can use the
-   special property =ALLTAGS= (which queries the same data as a normal
-   tags search) together with a regular expression:
+   : computer&email|work&email
 
-   : ALLTAGS={computer\|work}+email
+   This search will match all headlines tagged either with "computer"
+   and "email" or with "work" and "email." 
+
+3. Use [[http://orgmode.org/manual/Agenda-commands.html#Agenda-commands][agenda filtering]].
 
-   In the next section we'll learn more about how such property
-   searches are constructed.
+   Simply search for all headlines tagged with "computer" or "work"
+   and then use the agenda's tag filtering capabilities (=/=) to see
+   only those headlines among the results that have the tag "email."
 
 ** Property searches
    :PROPERTIES: