dotfiles/tools/print-matches.py

12 lines
150 B
Python
Raw Normal View History

import sys
import re
pattern = sys.argv[1]
p = re.compile(pattern)
for line in sys.stdin:
m = p.match(line)
if m:
print m.group(1)