Why is re.findall not being specific in finding triplet items in string. Python

后端 未结 4 945
故里飘歌
故里飘歌 2021-01-17 03:49

So I have four lines of code

seq= \'ATGGAAGTTGGATGAAAGTGGAGGTAAAGAGAAGACGTTTGA\'



OR_0 = re.findall(r\'ATG(?:...){9,}?(?:TAA|TAG|TGA)\',seq)  
4条回答
  •  迷失自我
    2021-01-17 04:09

    Try this:

    seq= 'ATGGAAGTTGGATGAAAGTGGAGGTAAAGAGAAGACGTTTGA'
    OR_0 = re.findall(r'ATG(?:.{3})*?(?:TAA|TAG|TGA)',seq) 
    

提交回复
热议问题