Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Identifying Overlapping Matches in Nucleotide Sequenceby Eily (Monsignor) |
on Oct 27, 2017 at 07:59 UTC ( [id://1202125]=note: print w/replies, xml ) | Need Help?? |
You can use the look ahead assertion (found in Extended Patterns), which makes perl search for a pattern and return to the previous position after the match (and /g doesn't allow perl to match exactly at the same position, so it will move by at least one char on the next attempt). ($myseq =~ /(?=AA)/gi ), or (?=(AA)) if you want to capture the matches (which isn't really useful when the pattern is AA).
In Section
Seekers of Perl Wisdom
|
|