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,
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?