怎么删除不想要的记录

怎么删除不想要的记录

如下:txt文件中我只列出了三个record, ,一个record分两个field,一个是TI, 一个是TX,    我想删除*FIELD* TI中第一符号是*的recod(或者选择第一个符号是*的记录),不知道正则表达式怎么写, *FIELD* TI中第一个字符后面总跟6位的数字,谢谢大家有益提示

*RECORD*
*FIELD* TI
+100050 AARSKOG
*FIELD* TX
....shawl scrotum as a main criterion.... ....

*RECORD*
*FIELD* TI
*100070 AORTIC AN
*FIELD* TX
......................main criterion.........................

*RECORD*
*FIELD* TI
#100070 AORTIC
*FIELD* TX
.................abdc.........................................
>>> a = '''*RECORD*
... *FIELD* TI
... +100050 AARSKOG
... *FIELD* TX
... ....shawl scrotum as a main criterion.... ....
...
... *RECORD*
... *FIELD* TI
... *100070 AORTIC AN
... *FIELD* TX
... ......................main criterion.........................
...
... *RECORD*
... *FIELD* TI
... #100070 AORTIC
... *FIELD* TX
... .................abdc.........................................'''
>>> import re
>>> b= re.split("\.+.*\s+", a)
>>> b
['*RECORD*\n*FIELD* TI\n+100050 AARSKOG\n*FIELD* TX\n', '*RECORD*\n*FIELD* TI\n*100070 AORTIC AN\n*FIELD* TX\n', '*RECORD*\n*FIELD* TI\n#100070 AORTIC\n*FIELD* TX\n.................abdc.........................................']
>>> c = filter(lambda x: x.split("\n")[2].startswith('*'), b)
>>> c
['*RECORD*\n*FIELD* TI\n*100070 AORTIC AN\n*FIELD* TX\n']


当然 最好全都用正则来写 我这个只是一个偷懒的办法