Thanks much,

That worked peachily!

Steve Tuckner

-----Original Message-----
From: Wayne Blair [mailto:wayne.blair / relian.com]
Sent: Monday, June 04, 2001 1:19 PM
To: ruby-talk / ruby-lang.org
Subject: [ruby-talk:16213] Re: Parsing Question



Hey,

I always make a small error when I post some code.  I forgot to dup the
commandLine string in my previous post.  This is what it should have been:

def parseCommandLine(aString)
  unparsedCommands=aString.dup  # need dup here point is to not mutate
string arg
  parsedCommands = []
  while  # remove commands from unparsedCommands as we find them
    unparsedCommands.sub!(/([a-zA-Z0-9]+)|"(\"|[^"])*"/) { parsedCommands <<
$&; ""}
  end
  return parsedCommands
end