searching substrings with interpositions

Cyril BAZIN cyril.bazin at gmail.com
Tue May 24 10:41:40 EDT 2005


Just another solution, pretty and effective:

def fct(a, b):
idx = -1
for c in a:
idx = b.find(c, idx+1)
if idx == -1:
return False
return True


On 24 May 2005 06:06:03 -0700, borges2003xx at yahoo.it <borges2003xx at yahoo.it> 
wrote:
> 
> thanx everyone, is what i need.
> As Claudio argues, it's a standard problem of dna sequences
> comparation.
> the next step of my job is to make limits of lenght of interposed
> sequences (if someone can help me in this way i'll apreciate a lot)
> thanx everyone.
> giorgio
> 
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20050524/9482dc84/attachment.html>


More information about the Python-list mailing list