From: kotin 76 Date: 2011-07-28T01:27:09+09:00 Subject: Re: if condition for pattern matching Hi , i applying same above logic for below program 1 2 #!/usr/bin/env ruby 3 5 dev2 = File.readlines("dev_string2.txt") 8 9 10 for i in dev2 11 devstring=i.match(/\/dev\/[\w]+/) 12 puts devstring 14 if devstring =~ %r{/dev/} then 15 puts "pass" 16 end 17 end but i am not able to print pass. pleas suggest any thing to print pass pleas find the attached file of dev_string2.txt Regards kotin Attachments: http://www.ruby-forum.com/attachment/6455/dev_string2.txt -- Posted via http://www.ruby-forum.com/.