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.
2f9f472bb3049369855be39c98bf6b8b?d=identicon&s=25 haomiao (Guest)
on 2007-07-26 01: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?
3afd3e5e05dc9310c89aa5762cc8dd1d?d=identicon&s=25 Tim Hunter (Guest)
on 2007-09-25 23:03
(Received via mailing list)
This topic is locked and can not be replied to.