From: kotin 76 Date: 2011-07-28T01:06:36+09:00 Subject: Re: if condition for pattern matching Hi all, i tried as per you suggestions from below program 1 string1 = '/dev/sda1' 2 3 if string1 =~ //dev\ then 4 puts pass 5 end But i getting below error. i think i may done mistake at regular expresson under if condition. Please sugget regular expression under if condtion to enter in to loop. i am looking for regular expression to enter into loop if it find "dev" in given string. ######################################## 7.rb:3: unknown regexp options - dv 7.rb:3: syntax error, unexpected $undefined, expecting keyword_then or ';' or '\n' if string1 =~ //dev\ then ^ 7.rb:5: syntax error, unexpected keyword_end, expecting $end ########################################## -- Posted via http://www.ruby-forum.com/.