Simple Regular Expression Needed...

Xiao-Qin Xia xx758 at cam.ac.uk
Wed Oct 9 08:08:13 EDT 2002


import re
s = """
<input>YOUNG J      STRONG   309   1356   1994
<input>FELDMAN DJ   WEAK  15    297    1962
Some other stuff
"""
print 
re.compile('(?<=<input>)([A-Z]+\s+[A-Z]+\s+(?:STRONG|WEAK)\s+\d+\s+\d+\s+\d+)\s*').findall(s)



More information about the Python-list mailing list