[Python-ideas] fnmatch/glob with sub-expressions

Erick Tryzelaar idadesub at users.sourceforge.net
Mon Jul 21 00:52:18 CEST 2008

I need to handle more advanced glob pattern matching than what
glob/fnmatch provides. I need to support patterns like this:

"a{b*c,d[ef]}" -> "a(b.*c|d[ef])$"
"a{b{c,d},e}" -> "a(b(c|d)|e)$"

This syntax is used in many shells, like bash and zsh, and other
languages, like ruby. Does anyone else think this might be worthwhile
in the standard library? It's a pretty simple change, but it could
break code though, so we'd probably have to disable it by default.

More information about the Python-ideas mailing list