On Tue, Mar 8, 2016 at 12:37 PM, Jinghui Niu <niujing...@gmail.com> wrote: > Let me try to describe the behaviours as much as I can here: It is a > real-time search, updating the search result as you type; It is very smart, > not limiting itself into the verbatim words, but extracting feature strings > automatically, e.g., typing "fontz" will match not just "*fontz*", but also > "font-size", "fontzipper", etc; It can be switched for certain type of files > according specific rules, such as not including ".pyc" files. > > My gut feeling is that it is using Regex, but just wonder how I can fit Regex > into either fnmatch() or glob() module.
Sounds to me like you're looking at two different things. 1) File name matching, whether with fnmatch or glob, will tell you which files to look at. You mention excluding .pyc files; you could specify that only "*.py" be matched, or "*q*.py", or whatever. 2) Regular expression or other searching, within the files. Either fnmatch or glob will serve you well for the first; I don't think they're appropriate for the second. But it depends what you're trying to do. ChrisA -- https://mail.python.org/mailman/listinfo/python-list