2006-02-26 String#scan scanはイテレータをとることができます。 s = "12,345?67-890" s.scan(/(\d+)/) do |n| puts n end __END__ 12 345 67 890