L
Li Chen
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?
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?