string split

Jacek Popławski jp at ulgo.koti.com.pl
Sun Dec 24 00:31:04 EST 2000


I have string:

s="one two <br> three"

splitting it gives:

['one', 'two', '<br>', 'three']

but if string looks like that:

s="one two<br> three"

string.split(s) gives me:

['one', 'two<br>', 'three']

is it possible to split not by space (" ") but by "<" and ">" ?

I need:

['one two','<br>','three']

How to do it in simple way?

-- 
The lover of life's not a sinner 
The ending is just a beginner
The closer you get to the meaning                             "Heaven and Hell" 
The sooner you'll know that you're dreaming                 - Ronnie James Dio



More information about the Python-list mailing list