From: James Edward Gray II Date: 2005-12-15T06:15:20+09:00 Subject: Re: regular expressions question On Dec 14, 2005, at 3:02 PM, ako... wrote: > hello, > > i need to capture all matches for a group. for example if > > 'ab c' =~ /^(.)*$/ > > i would like to get array [ 'a', 'b', ' ', 'c' ] > > could not figure out how to do it in ruby. String#scan did not seem to > be the right thing. please help. When using scan(), you need to remove the anchoring: >> "ab c".scan(/./) => ["a", "b", " ", "c"] Hope that helps. James Edward Gray II