Regex Question

Roy Smith roy at panix.com
Sat Aug 18 09:08:11 EDT 2012


In article 
<385e732e-1c02-4dd0-ab12-b92890bbed66 at o3g2000yqp.googlegroups.com>,
 Frank Koshti <frank.koshti at gmail.com> wrote:

> I'm new to regular expressions. I want to be able to match for tokens
> with all their properties in the following examples. I would
> appreciate some direction on how to proceed.
> 
> 
> <h1>@foo1</h1>
> <p>@foo2()</p>
> <p>@foo3(anything could go here)</p>

Don't try to parse HTML with regexes.  Use a real HTML parser, such as 
lxml (http://lxml.de/).



More information about the Python-list mailing list