From: Brad Mr Date: 2010-01-29T03:29:58+09:00 Subject: Re: Regex or line.each seems to not be working. Marvin G端lker wrote: > Brad Mr wrote: >> if line.scan(/^N\w\w\w/) > String#scan never returns false. I suppose you want #match: > > ruby -v: ruby 1.9.1p378 (2010-01-10 revision 26273) [x86_64-linux] > irb(main):001:0> "foo".scan(/^xxx/) > => [] > irb(main):002:0> "foo".match(/^xxx/) > => nil > irb(main):003:0> > > Marvin Perfect... Thanx man that did the trick.... Changed everything to "match" instead of "scan"... Keep a mental not on that. -- Posted via http://www.ruby-forum.com/.