Hi, Enclosed is a polished patch for full logical subexpressions, including manual updates for the syntax. This allows the following (from the manual): An expression consists of search terms joined by logical operators -a (and) and -o (or). The -a operator has precedence over -o and both are evaluated left-to-right. ( expr ) True if the subexpression expr is true. expr1 -a expr2 True if both expr1 and expr2 are true (logical "and"). expr1 [-o] expr2 True if expr1 and/or expr2 evaluate to true (logical "or"). term True if term is satisfied. This has syntax [key[,key]*(=~)]?val, where operand key is an mdoc(7) macro to query and val is its value. Operator = evaluates a substring, while ~ evaluates a regular expression. -i term Same as term, but term is evaluated case-insensitively. This patch also hides away backend "struct rec" components (lhs, rhs, matches) to apropos_db.c and adds lots of in-line documentation. Oks? If so, I'll check it in and get to work merging Ingo's excellent work. Thanks, Kristaps