File: regmatch.py

package info (click to toggle)
arping 2.26-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,084 kB
  • sloc: sh: 4,691; ansic: 3,894; exp: 405; python: 142; makefile: 34
file content (17 lines) | stat: -rwxr-xr-x 310 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python3

import re
import sys

rdata = '\\A' + open(sys.argv[1]).read() + '\\Z'
r = re.compile(rdata, re.MULTILINE | re.DOTALL)

data = sys.stdin.read()
m= r.findall(data)
if not m:
    #print("%s doesn't match %s" % (data, rdata))
    #print("NOO")
    sys.exit(1)
else:
    #print(m)
    pass