From: Dave Baldwin Date: 2011-07-28T00:54:46+09:00 Subject: Re: if condition for pattern matching On 27 Jul 2011, at 16:37, kotin 76 wrote: > Hi All, > > i have below program > > > ############################### > string1 = /dev/sda1 You need to quote the string, i.e. string1 = '/dev/sda1' Dave. > > if string1 =~ /\/dev\/ then > puts pass > end > ############################### > > my aim is if dev find in that string it should enter into conditon and > should print pass. > > but i getting error. > > can anyone suggest the logic for this. > > i would appreciate any replys > > Regards > kotin > > -- > Posted via http://www.ruby-forum.com/. >