Reg Expression - Get position of >

Duncan Booth duncan.booth at invalid.invalid
Wed Nov 26 05:38:38 EST 2008


"Chris Rebert" <clp at rebertia.com> wrote:

> On Wed, Nov 26, 2008 at 1:48 AM, M_H <heyer.mario at googlemail.com>
>>
>> I have a beginning of a (longer) string who is like:
>> mystr =  '<mimetype="text/html"><content><![CDATA['
>> or like
>> mystr =  '<mimetype="text/html" ><content><![CDATA['
>> or like
>> mystr =  '<mimetype="text/html" >
>>          NewLine <content><![CDATA['
>>
> 
> Any particular reason you're not using an HTML parser (e.g.
> BeautifulSoup) ? 
> 
It might possibly be because any kind of HTML or XML parser is going to get 
indigestion when fed a tag name followed by an equal sign.

However, a good question to the OP might be is there any particular reason 
your data looks vaguely xml like but isn't?

-- 
Duncan Booth http://kupuguy.blogspot.com



More information about the Python-list mailing list