All pastes #924542 Raw Edit

Untitled

public text v1 · immutable
·published 2008-03-01 13:28 UTC
rendered paste body
>>> import re
>>> mystring = 'blah.com meow'
>>> try: split = re.split(' ', mystring)
... except: split = [mystring]
...
>>> print split
['blah.com', 'meow']
>>> mystring = 'blah.com'
>>> try: split = re.split(' ', mystring)
... except: split = [mystring]
...
>>> print split
['blah.com']
>>>