From: Mike Stok Date: 2008-01-04T06:30:09+09:00 Subject: Re: Why does this code not return what I expect it to? On 3-Jan-08, at 4:23 PM, Sam Phoneix wrote: > Heres the code. Why does it miss out the "a" character? > ------------------------------------------ > "This is a test".scan(/\w\w/) {|x| puts x} > ------------------------------------------ > Thanks > -- > Posted via http://www.ruby-forum.com/. Have you researched what the \w matches in a regular expression, and considered how many of them there are in the argument to scan? Mike -- Mike Stok http://www.stok.ca/~mike/ The "`Stok' disclaimers" apply.