Shidan wrote: > I'm looking for a Python module that provides methods for ordering > regexes based on > how general they are ( how much they match). Do I have to write it > myself or does something exist already.
What do you mean by "how much they match" ? If you mean, what is the entire set of strings that is matched by the regex, then you have a hard problem. If you mean, which one matches more of one specific string, or a specific set of strings, then you can easily test each regex and pick the one with the longest match(es). Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor