If headlines in the agenda files are marked with tags (see Tags), or have properties (see Properties), you can select headlines based on this metadata and collect them into an agenda buffer. The match syntax described here also applies when creating sparse trees with C-c / m. The commands available in the tags list are described in Agenda commands.
A search string can use Boolean operators ‘&’ for AND and ‘|’ for
OR. ‘&’ binds more strongly than ‘|’. Parentheses are currently
not implemented. Each element in the search is either a tag, a regular
expression matching tags, or an expression like PROPERTY OPERATOR
VALUE with a comparison operator, accessing a property value. Each element
may be preceded by ‘-’, to select against it, and ‘+’ is syntactic
sugar for positive selection. The AND operator ‘&’ is optional when
‘+’ or ‘-’ is present. Here are some examples, using only tags.
You may also test for properties at the same time as matching tags, see the manual for more information.