Hi there Do you want your "*" to represent a single letter, or what is your intent?
If you want only a single letter between the "V" and "VVP", use "\w" instead of "*". re.search('v\wVVP',myseq) Emma On Tue, Dec 11, 2012 at 8:54 AM, Hs Hs <ilhs...@yahoo.com> wrote: > Dear group: > > I have 50 thousand lists. My aim is to search a pattern in the > alphabetical strings (these are protein sequence strings). > > > MMSASRLAGTLIPAMAFLSCVRPESWEPC VEVVP > NITYQCMELNFYKIPDNLPFSTKNLDLSFNPLRHLGSYSFFSFPELQVLDLSRCEIQTIED > > my aim is to find the list of string that has V*VVP. > > myseq = 'MMSASRLAGTLIPAMAFLSCVRPESWEPC VEVVP > NITYQCMELNFYKIPDNLPFSTKNLDLSFNPLRHLGSYSFFSFPELQVLDLSRCEIQTIED' > > if re.search('V*VVP',myseq): > print myseq > > the problem with this is, I am also finding junk with just VVP or VP etc. > > How can I strictly search for V*VVP only. > > Thanks for help. > > Hs > > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > >
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor