From: Michael campbell Date: 2003-10-17T09:13:35+09:00 Subject: Re: regexp problem Brett S Hallett wrote: > I'm trying to detect the string "0,0,0" ( that's numeric comma numeric > comma numeric) which is a value returned by cdrecord -scanbus > for detecting CD-ROM drives attached to a Linux system. > I have tried numerous regexp expressions but cannot get that string to > be detected. > > eg : "[0-9]\.[0-9]\,[0-9]" > > I assume that the comma is causing the trouble but even using \ escape ( > \,) does not solve the problem. > > Help please, thanks Your first "comma" there is a period, which would be ok except you've escaped it to mean a literal "." instead of its meta-char meaning of "any character". /[0-9],[0-9],[0-9]/.match("0,1,2") works for me.