Many of Mutt's commands allow you to specify a pattern to match (tag-pattern, delete-pattern, etc.). There are two methods to selecting messages. One is to use a simple range of messages. For example, to select messages one through twenty, you can use:
Tag messages matching: 1-20
The other method is to specify a search pattern. This is similar to the syntax of DejaNews, one of the WWW search engines. Mutt understands the following keywords:
To find messages that match more than one criterion, just append additional search parameters to your string. For example:
~t mutt ~f elkins
would select messages which contain the word ``mutt'' in the list of recipients and that have the word ``elkins'' in the FROM header field.
To do a logical OR operation, use the vertical bar (|). Example:
~t mutt | ~c mutt
would select all messages which contain the word ``mutt'' in either the TO or CC header fields.
You can also combined AND and OR operations in a single search for more complex operations. AND has precendence over the OR operation, so in the following example:
~f elkins ~t mutt | ~f elkins ~c mutt
is grouped logically as follows:
[ (FROM elkins) AND (TO mutt) ] OR [ (FROM elkins) AND (CC mutt) ]