fnmatch module : force case-insensitive comparison?

Jason R. Mastaler jason-dated-1005073044.62728a at mastaler.com
Mon Oct 29 13:57:22 EST 2001


I'd like to use the fnmatch module to do case-insensitive comparison
regardless of operating system.  This doesn't seem possible.

The fnmatchcase method if provided to do global case-sensitive
comparisons, but there is no converse (e.g, fnmatchnocase) method.

This seems like an oversight to me.

Actually, it would seem easier to me to just add an extra option to
the fnmatch method to specify whether the comparison should be
case-sensitive or case-insensitive, with the default being
OS-dependent.

fnmatch(filename, pattern[, comparison])





More information about the Python-list mailing list