On Mon, Jan 31, 2011 at 2:24 PM, Kamarulnizam Rahim <niezam54 / hotmail.com>wrote:

> Hi Josh,
>
> Thanks for the post. Problem solved. But i have one little question to
> ask. In order to get the data from row[1], i use the following code:
>
> next unless row[0] =~ /1.[a-z]/
> t = Target.new row[1]
>
> where '1.[a-z]' will take on any data with number '1'. The problem is,
> my csv data on row[1] has data till number '11'. and when i used the
> code above, it will take on data on number '1' and '11' as well. How do
> i separate this?
>
> Nizam
>
> --
> Posted via http://www.ruby-forum.com/.
>
>
In regular expressions, the period will match any character. So you need to
escape the period to basically say "match a period" not "match any
character"
/1\.[a-z]/