From: kotin 76 Date: 2011-07-28T01:55:37+09:00 Subject: Re: if condition for pattern matching Hi any one can reply for this? Regards kotin kotin 76 wrote in post #1013393: > 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 -- Posted via http://www.ruby-forum.com/.