[Tutor] regular expression wildcard search

Hs Hs ilhs_hs at yahoo.com
Tue Dec 11 16:54:50 CET 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20121211/8926990d/attachment.html>


More information about the Tutor mailing list