Stupid Regex Question

Jonas Galvez jonas at jonasgalvez.com
Wed Apr 21 12:30:10 EDT 2004


I'm feeling dumb:

str = "<tag>text<innertag>moretext</innertag></tag><tag>text</tag>"

How can I get a list like ["text<innertag>moretext</innertag>",
"text"] using regexes? I'm starting to believe it's not possible.

Yeah, I know about the terror stories about using regexes to parse
HTML, but in this particular case, using a SAX parser would be an
horrendous overhead (I mean, it's a ridiculously simple string).



=-
Jonas Galvez
jonasgalvez.com/blog
macromedia.com/go/team








More information about the Python-list mailing list