> Compile the glob pattern to an NFA and simulate the NFA efficiently
> (using Thompson's algorithm or even backtracking with memoization,
> rather than plain backtracking).
Well, I'm sure it would be much better, but that would be a rather
large piece of code, which would probably belong to a new regex
engine, no?
> I wrote an alternative regex implementation (it's on PyPI).
> It's a lot more resistant to catastrophic backtracking.
> What's need for fnmatch is a lot simpler than that! :-)
Yes, I know about your regex implementation, but it looks like it's
not going in anytime soon.
Do you think you could come up with a reasonable - i.e. self-contained
- patch for fnmatch?