Skip to content

Instantly share code, notes, and snippets.

@jbarratt
Created August 17, 2012 15:39
Show Gist options
  • Save jbarratt/3379994 to your computer and use it in GitHub Desktop.
Save jbarratt/3379994 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import re
filelist = ["foo.txt", "__foo.html", "bar.txt", "__bar.html", "baz.mp3"]
matchfiles = [i for i in filelist if i.startswith("__")]
matchre = [i for i in filelist if re.search('o+', i)]
print matchfiles
print matchre
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment