From: Li Chen Date: 2008-01-11T06:29:25+09:00 Subject: search pattern Hi all, I have a Ruby script as follow. What I try to do is to find a pattern in the string and report its position. I wonder how to get the position of pattern in the string. Thank you in advance, Li seq="5'aaaAAAAAACCCCCCCCTTTTTTTGGGGGGGGG-3'" seq.upcase!# change to upper case puts "old sequence:" puts seq.gsub!(/[^A-Z]/,'')# extract the string puts pattern if seq=~/AC/ #how to get the position of pattern in the string? -- Posted via http://www.ruby-forum.com/.