Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeff-minard-ck/6dd686811e8514a57dd219f292b97f67 to your computer and use it in GitHub Desktop.
Save jeff-minard-ck/6dd686811e8514a57dd219f292b97f67 to your computer and use it in GitHub Desktop.
>>> import fnmatch
>>> a = '/var/lib/docker/place/thing.sh'
>>> fnmatch.fnmatch(a, '/var/*')
True
>>> fnmatch.fnmatch(a, '/var/*/thing.sh')
True
>>> fnmatch.fnmatch(a, '/var/lib/docker/place/subplace/../thing.sh')
False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment