Skip to content

Instantly share code, notes, and snippets.

@JustinAzoff
Created February 12, 2016 20:02
Show Gist options
  • Save JustinAzoff/69589e2d46111d8470ec to your computer and use it in GitHub Desktop.
Save JustinAzoff/69589e2d46111d8470ec to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import re
import sys
regexes = [
"img.*jpg",
"baz.*etc",
]
compiled = [(r, re.compile(r)) for r in regexes]
for line in sys.stdin:
for r, rex in compiled:
if rex.search(line):
print r, line,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment