From: m b Date: 2011-06-14T05:26:03+09:00 Subject: Re: Regexp.match(line) question --_edf6cad0-7add-4a12-8fb8-f693eae1ce53_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable > > > if I do this: > > > > > > f=3Dopen('filename.dat'=2C'r') > > > str=3Df.read > > > > > > and then: > > > > > > str.each_line do |line| > > > /ruby/.match(line) > > > > > > ruby prints out variable line and say its a RegexpError > > > 'empty range in character class' as if it interprets line as a Rege= xp > > > What am I doing wrong? There are a lot of strange characters in vari= able line=2C > > > maybe that is the issue? I found out what I was doing the wrong way.. I'm reading the search pattern with readline and I wrote it -->/ruby/ =20 That didnt make it a Regexp. Now I found that if I write it -->ruby and then pattern=3DRegexp.new(input_str) it works.. /Mix = --_edf6cad0-7add-4a12-8fb8-f693eae1ce53_--