If Allow regular expressions is selected,
the search string may contain regular expressions similar to those used by
grep (actually, agrep), using these metacharacters:
[ ] ( ) | . ^ $ # < > { }
In this case, those characters must be preceded by a backslash (\)
to search for them literally.
^ and $ are special even if Allow regular expressions is not
selected, so must always be escaped with backslashes to search for them
literally.
Since the index is word based, a regular expression may not span more than one word. If multiple words are given, they are searched for as a contiguous string, and the resulting string will only be found if it occurs on a single line in a file.
AND and OR are specified with ; and , respectively. They cannot be combined with each other, and by default AND works within the span of only one line of a file. For example, foo;bar will return all files that have a line that contains the word foo and the word bar (in any order). If Whole file AND is turned on, AND works across the scope of an entire file, and after files are selected the terms of the query are ORed when selecting lines from the file. In this case, the above example would find all files that contain the word foo and the word bar, and then show any lines that contain either word.
For more details, see the manual entries for glimpse and agrep.