Skip to content

Commit

Permalink
Regex updated in bin/asngen.py to exclude quotes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Trusted Subject committed Jan 10, 2019
1 parent 41d8eea commit fe609c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/asngen.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def generate(self):
raise Exception("Received response: " + url.getcode())

for name in zipfile.namelist():
entries = re.findall(r'^(\d+\.\d+\.\d+\.\d+)\/(\d+),(\d+),(.*)', zipfile.open(name).read(), re.MULTILINE)
entries = re.findall(r'^(\d+\.\d+\.\d+\.\d+)\/(\d+),(\d+),\"?([^\"\n]+)\"?', zipfile.open(name).read(), re.MULTILINE)

for line in entries:
yield {'ip': line[0] + "/" + line[1], 'asn': line[2], 'autonomous_system': line[3].decode('utf-8', 'ignore')}
Expand Down

0 comments on commit fe609c7

Please sign in to comment.