Forum: Ruby what regexp can split a string to argv

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
haomiao (Guest)
on 2007-07-26 03:39
(Received via mailing list)
Hi
       I want to split a string to a array like shell doing. And the
double qote string must be support.
       For example
             '1 2  " 3 4 5"  6 '  => ['1', '2', '2 4 5', '6']
             '1 2  7"3 4 5"6'    => ['1', '2', '72 4 56']
       Can regexp do this ?
       Or any other way?
Tim H. (Guest)
on 2007-09-26 01:03
(Received via mailing list)
This topic is locked and can not be replied to.