From: Ari Brown Date: 2007-07-20T11:23:16+09:00 Subject: Re: simple question or a gem called 'OptionParser'. It's like optparse, only, I find, a lot simpler. On Jul 19, 2007, at 10:19 PM, Michael Hollins wrote: > anitawa wrote: >> hello >> I have a string like this >> string = "hello -a apple -b butterfly -c cat -d dophin" >> i would like to parse the string based on some reg exp so that i can >> store it in a variable like so. >> valuea = "apple" >> valueb = "butterfly" >> valuec = "cat" >> valued = "dophin" >> Could someone help me out. > > Are you parsing a command line? If so, you might want to consider > http://www.ruby-doc.org/stdlib/libdoc/optparse/rdoc/index.html > > cheers, > mick > > ---------------------------------------------------------------| ~Ari "I don't suffer from insanity. I enjoy every minute of it" --1337est man alive