From: Heinrich Piard Date: 2008-01-14T06:43:49+09:00 Subject: Re: regualr expression (need help) Sebastian Hungerecker wrote: > Mike McKinney wrote: >> should do : >> >> � � ValidDate = File.readlines('someFile.txt').to_s.grep(/Not After/) > > Yes, and leave out the to_s, too. If you want a string use File.read > instead > of File.readlines. In this case you can use both, though, since String > and > Array both have a grep method. But using readlines to get an array and > then > converting it to string via to_s, doesn't make sense. > > HTH, > Sebastian Thanks guys, I did include those changes in my code. bye Henry -- Posted via http://www.ruby-forum.com/.