This is a query tool for XMLTV files. It allows you to do regular expression matching against the content of programme or channel subelements, for example matching the title or description. Anything which is 'human-readable text' can be matched. The list of predicates available and part of the documentation are generated from XMLTV.pm, so when the file format changes so does the grep tool. Not everything can be queried like this, but you can regexp an entire programme.
Also has a few special features - evaluate arbitrary Perl code for each programme, and filter out programmes which you have missed (their stop date is in the past).
Sort listings into date order. Also takes the opportunity to add stop times to programmes missing them and sanity-check things like no overlap.