Searching for pattern matches with k mismatches

Mark Robinson m.1.robinson at herts.ac.uk
Thu Jan 31 10:15:33 EST 2002


Hi guys,

I was wondering if anyone could help with ideas for the
following problem. I want to search a string for all
matches to a substring (easy enough with re) but allowing
the matches to contain k number of mismatches.

I can do it the brute force way, by checking every
single pattern individually and comparing character
by character but that is as slow as......well me doing
it.

Is there a fast, efficient way to do it. I tried to think
of a way to achieve it with regular expressions but just
gave myself a headache.

tia

Blobby
-- 
Mark Robinson
Research Programmer
Biocomputation Group
Science and Technology Centre
University of Hertfordshire
Herts, UK
AL10 9AB

http://strc.herts.ac.uk/bio/markr/




More information about the Python-list mailing list