[racket] Split string except quoted

From: Richard Parsons (richard.lee.parsons at gmail.com)
Date: Fri Aug 16 16:16:48 EDT 2013

Hi there, I'm new to Racket.

I'm trying to split strings on whitespace except when quoted, such as this:

"one two three \"four five\"" => '("one" "two" "three" "four five")

In Python, this could be done with shlex.split().

Perhaps I could do it with a lexer?

Perhaps I could do it with regular expressions?

Perhaps the source code for current-command-line-arguments could show me
how to do it, although I can't work out how to locate it.

Any suggestions anyone?

Many thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130816/06ea1536/attachment.html>

Posted on the users mailing list.