When you're iterating over hundreds of lines in a file, what is the most (and least) efficient way to run regular expressions in Python?
Specifically, is the following bad form?
for line in file:
data = re.search('(\d+\.\d+)\|(-\d+\.\d+)\|(.*?)\|(.*?)\|(\d+:\d+\s+\w+)\sTO\s(.*?)',line)
one = data.group(1)
two = data.group(2)
three = data.group(3)
four = data.group(4)
five = data.group(5)
six = data.group(6)
# do the magic...