#! encoding=gbk
import re
file_object = open('1.txt')
f = open("2.txt","w")
for line in file_object:
m = re.findall('(thunder(.+)pa)',line)
if m:
print >> f,m[0][0];
f.close()
file_object.close()
version 2
#! encoding=gbk
import re
file_object = open('1.txt')
f = open("2.txt","w")
for line in file_object:
m = re.findall('thunder.+pa',line)
if m:
print >> f,m[0];
f.close()
file_object.close()