Re: [Tutor] regular expression wildcard search

2012-12-11 Thread Alan Gauld
On 11/12/12 15:54, Hs Hs wrote: myseq = 'MMSASRLAGTLIPAMAFLSCVRPESWEPC VEVVP NITYQCMELNFYKIPDNLPFSTKNLDLSFNPLRHLGSYSFFSFPELQVLDLSRCEIQTIED' if re.search('V*VVP',myseq): print myseq I hope this is just a typo but you are printing your original string not the things found... -- Alan G Autho

Re: [Tutor] regular expression wildcard search

2012-12-11 Thread Joel Goldstick
On Tue, Dec 11, 2012 at 10:54 AM, Hs Hs wrote: > Dear group: > Please send mail as plain text. It is easier to read > > I have 50 thousand lists. My aim is to search a pattern in the > alphabetical strings (these are protein sequence strings). > > > MMSASRLAGTLIPAMAFLSCVRPESWEPC VEVVP > NITYQC

Re: [Tutor] regular expression wildcard search

2012-12-11 Thread Emma Birath
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 wrote: > Dear group: > > I have 50 thousand lists. My

[Tutor] regular expression wildcard search

2012-12-11 Thread Hs Hs
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