-
-
Save SeqviriouM/7250565 to your computer and use it in GitHub Desktop.
Homework_3_IPv6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
fr = open('access.log','r') | |
ip = re.compile('^([0-9a-fA-F]?[0-9a-fA-F]?[0-9a-fA-F]?[0-9a-fA-F]?(:| )){1,8}') | |
count = 0 | |
for line in fr: | |
if ip.search(line) != None: | |
count+=1 | |
print count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment