It would be nice if fnmatch also supported the standard alternaltion syntax for wildcards, where "abc.{def,ghi}.jkl" matches either abc.def.jkl or "abc.gji.jkl".
Attached is a modified version of the function that does that.
Like the current implementation, the additions lack an escape syntax. So it's not possible to match filename with a literal ',' or '{'. (Just like the current function is unable to match a literal '[', '*' or '?' in a filename)
Comment #1 by wbaxter — 2009-02-11T22:00:09Z
Created attachment 289
fnmatch function enhanced with {,} patterns