python regular Expression splitting a string -
i want split sting c='[ 6638.392700] entered command e0, 00, 01'
in to
['6638.392700','entered command e0, 00, 01' ].
i want split number in [data] string. how can achive that? tried below:
re.split(r'([\d*])',c,re.i)
but giving me output ..
['[ ', '6', '', '6', '', '3', '', '8', '.', '3', '', '9', '', '2', '', '7', '', '0', '', '0', ']
entered text e', '0', ', ', '0', '', '0', ', ', '0', '', '1', '']
how can achieve desired output?
define string:
>>> c = '[ 6638.392700] entered command e0, 00, 01'
split it:
>>> c.replace('[','').split(']') [' 6638.392700', ' entered command e0, 00, 01']