When I run the following commands under ipython;
>>> s = '{\f226 Please press the} "{\f226 Input}'
>>> re.findall(r'\{\f226.*?\}',s)
['{\x0c226 Please press the}', '{\x0c226 Input}']
When I run the same command under a python script, it gives me an empty list. I use the same Python versions.
import sys, codecs, re
if __name__ == "__main__":
f = sys.argv[1]
tn = f + ".fixed"
f = codecs.open(f, encoding="utf-8").read()
brackets = re.findall(r'\{\f226.*?\}', f)
nonbrackets = re.findall(r'\{\f226(.*?)\}', f)
print brackets
The result is []
. What should I do?