1
2
3
4
5
6
7
8
9
10
11
12
13
import re

regex = input("REGEX: ") # Input Search Term

SearchFunction = re.compile(regex) # Insert Search Term Function

f = open('data','r', encoding='utf-8') # Open File

for line in f:
    result = re.search(SearchFunction, line)
print(result.groups())

f.close()