From: Phillip Gawlowski Date: 2011-04-08T03:39:37+09:00 Subject: Re: String.gsub with regex and block On Thu, Apr 7, 2011 at 8:10 PM, 7stud -- wrote: > > "John Smith".scan(/\S+/) do |match| >  puts match > end irb(main):001:0> "John;Smith".scan /\S+/ do |match| irb(main):002:1* puts match irb(main):003:1> end John;Smith => "John;Smith" Ups. Better: irb(main):04:0> "John;Smith".scan /\w+/ do |match| irb(main):05:1* puts match irb(main):06:1> end John Smith The code still makes assumptions about the data, though: it is uniform in that only the first n parts are the name, and not n[+|-]1. -- Phillip Gawlowski Though the folk I have met, (Ah, how soon!) they forget When I've moved on to some other place, There may be one or two, When I've played and passed through, Who'll remember my song or my face.