[docs] [issue8402] Add a function to escape metacharacters in glob/fnmatch

Matthew Barnett report at bugs.python.org
Thu Mar 7 17:28:04 CET 2013

Matthew Barnett added the comment:

I've attached fnmatch_implementation.py, which is a simple pure-Python implementation of the fnmatch function.

It's not as susceptible to catastrophic backtracking as the current re-based one. For example:

fnmatch('a' * 50, '*a*' * 50)

completes quickly.

nosy: +mrabarnett
Added file: http://bugs.python.org/file29343/fnmatch_implementation.py

Python tracker <report at bugs.python.org>

More information about the docs mailing list