Shell style globbing instead or re syntax?

Donn Cave donn at
Tue Aug 13 12:30:33 EDT 2002

Quoth bruce edge <bruce_edge at>:
| I'd doing a command line interface thingy in python.
| I want to support expressions for args, while I like python's re syntax,
| it's not what users expect.
| They're more used to bash style globbing. Is there a lib somewhere that I
| can use for this?
| glob doesn't work because it only works on filenames.

from fnmatch import fnmatchcase
matches = fnmatchcase(name, pattern)

NB, I guess it's bash style globbing, but of course it pre-dates
bash by many years.

	Donn Cave, donn at

More information about the Python-list mailing list