How to do this in python with regular expressions

Jia Lu Roka100 at gmail.com
Fri May 25 07:51:35 EDT 2007


Hi all

 I'm trying to parsing html with re module.

 html = """
 <TABLE BORDER=1 cellspacing=0 cellpadding=2>
<TR>

<TH nowrap>DATA1</TH><TH nowrap>DATA2</HT><TH nowrap>DATA3</
HT><TH>DATA4</TH>
</TR>

<TR><TD>DATA5</TD><TD>DATA6</TD><TD>DATA7</TD><TD>DATA8</TD></TR>

</TABLE>
"""

I want to get DATA1-8 from that string.(DATA maybe not english words.)
Can anyone tell me how to do it with regular expression in python?

Thank you very much.




More information about the Python-list mailing list