From: "Sandor Szücs" Date: 2008-07-14T21:14:15+09:00 Subject: Re: the Regular exp read from file not matching !! On 14.07.2008, at 09:38, Jayan Jacob wrote: > When I use /^[0-1]{1}$/ with "1" as subject it works but > /^[0-1]{1}[a-zA-Z]{1,25}$/ syntax for "1,abcd" , I have checked out on > the interpreter directly both works fine. I suppose I am messing up > something with the files, or gets or chomp or .. > > Any help ? That RegEx: /^[0-1]{1}[a-zA-Z]{1,25}$/ doesn't match ','. maybe: add ',' irb> regex2=/^[0-1]{1},[a-zA-Z]{1,25}$/ => /^[0-1]{1},[a-zA-Z]{1,25}$/ irb> regex2.match "1,abcd" => # or '.?' irb> regex3=/^[0-1]{1}.?[a-zA-Z]{1,25}$/ => /^[0-1]{1}.?[a-zA-Z]{1,25}$/ irb> regex3.match "1,abcd" => # hth. regards, Sandor Szücs --