is there any lib can split string in this way?

bonono at gmail.com bonono at gmail.com
Mon Jan 9 01:08:16 EST 2006


This has been asked not long ago. the shlex module as well as csv
module both should be able to handle it. for this simple case
shlex.split() seems to be the easiest.

Leo Jay wrote:
> I want to split a string like this:
> 'abc  def  "this is a test"  ok'
> into:
> ['abc', 'def', 'this is a test', 'ok']
>
> is there any lib meet my need?
> 
> thanks
> 
> --
> Best Regards,
> Leo Jay




More information about the Python-list mailing list