Possible Duplicate:
Python strings split with multiple separators
Is there a way in Python to split a string on two different keys?
Say I have a string like this:
mystr = "wketjwlektjwltjkw<br/>wwwweltjwetlkwjww" + \
"wwetlwjtwlet<strong>wwwwketjwlektjwlk</strong"
I'd like to split on EITHER <br/>wwww
or <strong>wwww
.
How should I do this?
Thanks!
' or 'wwww>') works if you want that whichever exists first gets split into 2 lists.... – Dec 20 '10 at 12:57
' or 'wwww>'` first, resulting in `'
'`. – Lucas Moeskops Dec 20 '10 at 12:59