All string patterns in Mutt including those in more complex patterns must be specified using regular expressions (regexp) in the ``POSIX extended'' syntax (which is more or less the syntax used by egrep and GNU awk). For your convenience, we have included below a brief description of this syntax.
The search is case sensitive if the pattern contains at least one upper case letter, and case insensitive otherwise. Note that ``\'' must be quoted if used for a regular expression in an initialization command: ``\\''.
A regular expression is a pattern that describes a set of strings. Regular expressions are constructed analogously to arithmetic expressions, by using various operators to combine smaller expressions.
The fundamental building blocks are the regular expressions that match a single character. Most characters, including all letters and digits, are regular expressions that match themselves. Any metacharacter with special meaning may be quoted by preceding it with a backslash.
The period ``.'' matches any single character. The caret ``^'' and the dollar sign ``$'' are metacharacters that respectively match the empty string at the beginning and end of a line.
A list of characters enclosed by ``['' and ``]'' matches any single character in that list; if the first character of the list is a caret ``^'' then it matches any character not in the list. For example, the regular expression [0123456789] matches any single digit. A range of ASCII characters may be specified by giving the first and last characters, separated by a hyphen ``‐''. Most metacharacters lose their special meaning inside lists. To include a literal ``]'' place it first in the list. Similarly, to include a literal ``^'' place it anywhere but first. Finally, to include a literal hyphen ``‐'' place it last.
Certain named classes of characters are predefined. Character classes consist of ``[:'', a keyword denoting the class, and ``:]''. The following classes are defined by the POSIX standard:
Alphanumeric characters.
Alphabetic characters.
Space or tab characters.
Control characters.
Numeric characters.
Characters that are both printable and visible. (A space is printable, but not visible, while an ``a'' is both.)
Lower-case alphabetic characters.
Printable characters (characters that are not control characters.)
Punctuation characters (characters that are not letter, digits, control characters, or space characters).
Space characters (such as space, tab and formfeed, to name a few).
Upper-case alphabetic characters.
Characters that are hexadecimal digits.
A character class is only valid in a regular expression inside the brackets of a character list. Note that the brackets in these class names are part of the symbolic names, and must be included in addition to the brackets delimiting the bracket list. For example, [[:digit:]] is equivalent to [0-9].
Two additional special sequences can appear in character lists. These apply to non-ASCII character sets, which can have single symbols (called collating elements) that are represented with more than one character, as well as several c