From: John Gabriele Date: 2006-10-03T03:02:04+09:00 Subject: Re: Ruby for Sysadmin On 10/2/06, Logan Capaldo wrote: > On Tue, Oct 03, 2006 at 12:17:24AM +0900, Ron Mr. wrote: > > I need to write a script that pulls usernames our of a file that is > > formatted like the following. > > > > [snip] > > Hope this helps: > > % cat parse.rb > #!/usr/bin/env ruby > > DATA.each do |line| > if md = line.match(/^\"([^"]+)\"\s*(.*)$/) > name, remaining_fields = md[1], md[2] > [snip] > Just curious, why do you backslash escape the double-quote marks? I don't think they're special inside a regex, and the match works without the backslashes.