Mserv: http://www.mserv.org I've written a replacement for the mserv filter mechanism. It's backward-compatible with the old filter (cross my fingers) , but adds some new features. Overview: - The old filter re-parsed the command line for every song it filtered. The new one pre-parses the command line, building a parse tree and that is utilized when evaluating each song. Thus, it's faster when processing huge numbers of songs. - The new filter uses short-circuit logic to improve performance. - The new filter has some additional syntax. - The old filter only had "search=" which did substring searches on title and author, the new one adds "author=" and "title=" which do exact matches. For example, "searchf author=bond" will get my Bond sountrack but not pick up other songs with "bond" somewhere in the song name. The compare does skip "The " at the start of songs, though, so "searchf author=beatles" will match both "Beatles" and "The Beatles". It does support a wildcard '*' at the end of a string (but not the middle). - The new filter supports arbitrary length, whereas the old one used arrays and therefore had some limits. - Whitespace is allowed, allowing expressions to be more legible. Details: Operator & precedence (unchanged except new =~): () (highest) comparison operators: = == < > <= >= =~ ! | & (lowest) Evaluation is left to right. The new =~ is a substring search operator (strings only). The rest of the operators work on both strings (new feature) and numbers. Both = and == are equivalence operators. Ratings: superb, good, neutral, bad, awful Quoting: The RHS of comparisons can now be quoted. If the next non-whitespace character after the operator is a single or double quote, then the string is collected up to the close quote, which must be the same type as the open quote. Keywords: --Binary-- HEARD RATED True if the song has been heard, rated, or given the specific rating (respectively) by any currently logged in user. (Conforms to existing behavior.) PLAYED True if the song has ever been played. Equivalent to LASTPLAY > 0. --String-- = True if has assigned , if the user has heard a song, or if the user has rated the song respectively. Rating may be one of superb, good, neutral, bad, or awful. GENRE [ = =~ ] True if a song belongs to . Note that the old mechanism expected multiple genres to be separated by commas, the new one also recognizes slashes and plus (which is how a many are listed on FreeDb and CDDB). =~ will do a substring match rather than matching genre name - so use this if you want to do something like GENRE =~ "ROCK/POP". SEARCH [ = =~ ] True if there is a substring match on title or author. SEARCH doesn't support other string comparisons. ALBUMNAME pattern AUTHOR pattern TITLE pattern Compare the various components to the pattern. can be any of the comparison operators. --Numeric-- ALBUM number Compare album number. For numeric comparison, any operator except the substring search (=~) is applicable. DURATION number Compare duration of song, in seconds. LASTPLAY number - last played in hours Compare last played time, in hours. TRACK number Compare track number. YEAR number Compare year. If the year isn't set, year number returns false. (That is, unset years aren't equal to year = 0.) Thanks: Thanks to Kimmo Suominen for documenting the existing syntax at http://kimmo.suominen.com/docs/mserv-filters/ It was _very_ helpful along the way. -- Do I suffer from long term memory loss?... I don't remember.