~cyplo/dotfiles

ref: 1ca69547b9a678da7a89ac93b7822ac478a2ab7d dotfiles/tools/print-matches.py -rw-r--r-- 150 bytes
1ca69547 — Cyryl Płotnicki update 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
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)