space / nonspace

Peter Kleiweg p.c.j.kleiweg at rug.nl
Sun Jul 22 16:33:08 EDT 2007


    >>> import re
    >>> s = u'a b\u00A0c d'
    >>> s.split()
    [u'a', u'b', u'c', u'd']
    >>> re.findall(r'\S+', s)
    [u'a', u'b\xa0c', u'd']  


This isn't documented either:

    >>> s = ' b c '
    >>> s.split()
    ['b', 'c']
    >>> s.split(' ')
    ['', 'b', 'c', '']

   

-- 
Peter



More information about the Python-list mailing list