I am trying to write a matching engine for a matching language for a filtering proxy compatible with that of The Proxomitron. The matching language is basically an extended superset of shell-style globs, with functionality comparable to regexps (see http://www.proxomitron.info/45/help/Matching%20Rules.html). Can anyone recommend any Python libraries that would be suitable for my purposes? I think that I can implement a parser for the patterns themselves with pyparsing, but I'm not sure if anything suitable for finding matches in an input stream of text exists. I don't want to reinvent the wheel if I don't have to.
A matching engine for a filtering proxy has to be able to handle partial input and "hold" data until enough is received to determine whether there is a match (or else the entire document would have to be held until the end is reached, filtered, and then sent all at once to the remote client, and that would make it appear much less responsive and possibly break some applications). I also need to be able to associate specific patterns (matching commands and certain backslash-escapes) with functions that are called to determine if they match. -- http://mail.python.org/mailman/listinfo/python-list