Perl Monk, Perl Meditation | |
PerlMonks |
Re^4: Perl regular expression for amino acid sequenceby Roy Johnson (Monsignor) |
on Dec 01, 2004 at 20:17 UTC ( [id://411552]=note: print w/replies, xml ) | Need Help?? |
The problem with using two regexes is: if it matches and then gets rejected, your pos counter is still incremented. Say you match a string of 6 chars, QGYNNN. What you want from that is QGYNN (right, OP?), but what happens is that all six characters get tossed.
That brings me to a flaw in my proposed solution: it will only give you QGYN from the above input. Needs some tweaking. Caution: Contents may have been coded under pressure.
In Section
Seekers of Perl Wisdom
|
|