Many search terms take a string as a parameter and match it
against one or more fields of a package. Strings can be
entered either with or without double quotes
perform the same search.
If you enter a “bare” string, one not
surrounded by double quotes, then aptitude will consider
the string to have “ended” when it encounters
the closing parenthesis or the comma before a second
argument to the search term.
To remove the special meaning of these characters, place a
~”) directly before
them. For instance,
is a syntax error, because the first
?description term, and the
) does not match anything. In
package whose description contains the text
etc)”. There are
additional considerations if you are using the shorthand
notation for a term; see the section called “Shorthand for search terms” for details.
Most textual searches (for package names, descriptions, etc) are performed using case-insensitive regular expressions. This means that you must backslash-escape regular expression metacharacters  in searches (for instance, to find “g++”, you should use the pattern “g\+\+”).
While this behavior is well-defined, it may be surprising; I recommend using quoted strings for any pattern that contains characters that could have a special meaning.
Regular expression metacharacters include:
“+”, “-”, “.”,
“(”, “)”, “|”,
“[”, “]”, “^”,
“$”, and “?”. Note that some
of these are also aptitude metacharacters, so if you
want to type (for instance) a literal “|”,
it must be double-escaped: