On 2010-04-08, Patrick Maupin <pmau...@gmail.com> wrote: > On Apr 7, 4:47?pm, Grant Edwards <inva...@invalid.invalid> wrote: >> On 2010-04-07, J <dreadpiratej...@gmail.com> wrote: >> >> > Can someone make me un-crazy? >> >> Definitely. ?Regex is driving you crazy, so don't use a regex. >> >> ? inputString = "# 1 ?Short offline ? ? ? Completed without error ? ? 00% ? >> ? ? 679 ? ? ? ? -" >> >> ? print ' '.join(inputString.split()[4:-3]) [...]
> OK, fine. Post a better solution to this problem than: > >>>> import re >>>> re.split(' {2,}', '# 1 Short offline Completed without error >>>> 00%') > ['# 1', 'Short offline', 'Completed without error', '00%'] OK, I'll bite: what's wrong with the solution I already posted? -- Grant -- http://mail.python.org/mailman/listinfo/python-list