re.compile().split(): why it produces empty string as a first element of the list

alf ask at me
Wed Sep 27 00:40:01 EDT 2006


Hi,
Let's run following:

 >>> re.compile('(\[.*?\])').split('[aa]bb[11]22')
['', '[aa]', 'bb', '[11]', '22']


Why does it return '' as a first element of the list?

Any insight?

-- 
alf



More information about the Python-list mailing list