From: Logan Capaldo Date: 2005-03-17T10:12:57+09:00 Subject: Re: Examples for racc? Heres a thought, use optparse: require 'optparse' require 'shellwords' gcc_inv = GCCInvocation.new args = Shellwords.shellwords "-D__DEBUG__..." optparser = OptionParser.new optparser.on("-D") do |arg| gcc_inv.debug << arg end The above is sloppy and mostly wrong, but I don't have Ruby on this machine to do it properly. Just an alternative idea. Especailly since you won't have to write a new regexp everytime you want to add a option to your class.