import collections
import heapq
import re

ipset = set()
prodcount = collections.defaultdict(int)
ipv4_pattern = re.compile("^(([01]?[0-9][0-9]?|25[0-5]|2[0-4][0-9]|)\\.){3}([01]?[0-9][0-9]?|25[0-5]|2[0-4][0-9]|)$")

file = open('weblog.txt', 'r')

for line in file:
    words = line.split()

    for word in words:
        if ipv4_pattern.match(word):
            print("valid IP:" +word)

            

b116a26312998b52c7a095e681e5aa396c687088
<mask token>

<mask token>
for line in file:
    words = line.split()
    for word in words:
        if ipv4_pattern.match(word):
            print('valid IP:' + word)

<mask token>
ipset = set()
prodcount = collections.defaultdict(int)
ipv4_pattern = re.compile(
    '^(([01]?[0-9][0-9]?|25[0-5]|2[0-4][0-9]|)\\.){3}([01]?[0-9][0-9]?|25[0-5]|2[0-4][0-9]|)$'
    )
file = open('weblog.txt', 'r')
for line in file:
    words = line.split()
    for word in words:
        if ipv4_pattern.match(word):
            print('valid IP:' + word)

import collections
import heapq
import re
ipset = set()
prodcount = collections.defaultdict(int)
ipv4_pattern = re.compile(
    '^(([01]?[0-9][0-9]?|25[0-5]|2[0-4][0-9]|)\\.){3}([01]?[0-9][0-9]?|25[0-5]|2[0-4][0-9]|)$'
    )
file = open('weblog.txt', 'r')
for line in file:
    words = line.split()
    for word in words:
        if ipv4_pattern.match(word):
            print('valid IP:' + word)

import collections
import heapq
import re

ipset = set()
prodcount = collections.defaultdict(int)
ipv4_pattern = re.compile("^(([01]?[0-9][0-9]?|25[0-5]|2[0-4][0-9]|)\\.){3}([01]?[0-9][0-9]?|25[0-5]|2[0-4][0-9]|)$")

file = open('weblog.txt', 'r')

for line in file:
    words = line.split()

    for word in words:
        if ipv4_pattern.match(word):
            print("valid IP:" +word)

            
