Pythonでワイルドカードマッチング

Pythonワイルドカードマッチングしたい!そんなあなたはfnmatchを使いましょう。

>>> fnmatch.fnmatch('http://www.google.com/', 'http://*/*')
True
>>> fnmatch.fnmatch('http://www.google.com/foo/baz/bar', 'http://*.google.com/foo*bar')
True
>>> fnmatch.fnmatch('hoge', 'hoge')
True

うん便利。