Previous: Setting tags, Up: Tags
Once a tags system has been set up, it can be used to collect related information into special lists.
org-tags-match-list-sublevels).
A tags search string can use Boolean operators `&' for AND and `|' for OR. `&' binds more strongly than `|'. Parenthesis are currently not implemented. A tag may also be preceded by `-', to select against it, and `+' is syntactic sugar for positive selection. The AND operator `&' is optional when `+' or `-' is present. Examples:
If you are using multi-state TODO keywords (see TODO extensions), it can be useful to also match on the TODO keyword. This can be done by adding a condition after a slash to a tags match. The syntax is similar to the tag matches, but should be applied with consideration: For example, a positive selection on several TODO keywords can not meaningfully be combined with boolean AND. However, negative selection combined with AND can be meaningful. To make sure that only lines are checked that actually have any TODO keyword, use C-c a M, or equivalently start the todo part after the slash with `!'. Examples:
Any element of the tag/todo match can be a regular expression - in this case it must be enclosed in curly braces. For example, `WORK+{^BOSS.*}' matches headlines that contain the tag `WORK' and any tag starting with `BOSS'.
You can also require a headline to be of a certain level, by writing instead of any TAG an expression like `LEVEL=3'. For example, a search `+LEVEL=3+BOSS/-DONE' lists all level three headlines that have the tag BOSS and are not marked with the todo keyword DONE.