Wondering in Python 2.7, if I need to use the same regular expression multiple times, to match different content, compile
first is always better performance? Thanks.
I show what I mean by below examples,
import re
content = '{(1) hello (1)}'
reg = '{\(1\)(.*?)\(1\)}'
results = re.findall(reg, content)
print results[0]
prog = re.compile(reg)
results = prog.findall(content)
print results[0]
regards, Lin