Dear All,
I want to search a substring in a string allow certain number of mismateches
I have two strings
>>> S1
'ATAGCACTGC'
>>> S2
'ACAGCATTGC'
I want to allow 2 mismatches in this case and I mean to say if it has 2 mismatches, it should say strings are matched and want to know what indexes mismatches there and what are those mismatches
>>> regex.match('(ATAGCACTGC){e<=2}', 'ACAGCATTGC')
<regex.Match object; span=(0, 10), match='ACAGCATTGC', fuzzy_counts=(2, 0, 0)>
is working
but if give S1 or S2 instead of actual string it is not working
regex.match(S1 + '{e<=2}',S2)
regex.match(S1'{e<=2}',S2) etc all are giving syntax errors
Thanks,
Anusha
I want to search a substring in a string allow certain number of mismateches
I have two strings
>>> S1
'ATAGCACTGC'
>>> S2
'ACAGCATTGC'
I want to allow 2 mismatches in this case and I mean to say if it has 2 mismatches, it should say strings are matched and want to know what indexes mismatches there and what are those mismatches
>>> regex.match('(ATAGCACTGC){e<=2}', 'ACAGCATTGC')
<regex.Match object; span=(0, 10), match='ACAGCATTGC', fuzzy_counts=(2, 0, 0)>
is working
but if give S1 or S2 instead of actual string it is not working
regex.match(S1 + '{e<=2}',S2)
regex.match(S1'{e<=2}',S2) etc all are giving syntax errors
Thanks,
Anusha
Comment