2024-09-27 02:22:10 发布
网友
正在努力寻找序列“TAA”(三个字符的三胞胎)“TAA”。
我尝试了以下方法:
re.findall('TAA...+?TAA',seq)这当然不是三胞胎,而是序列
re.findall('TAA...+?TAA',seq)
re.findall('TAA([ATGC]{3})+?TAA' , seq)但是给了我一个列表作为输出
re.findall('TAA([ATGC]{3})+?TAA' , seq)
'AGG', 'TCT', 'GTG', 'TGG', 'TGA', 'TAT',
有什么想法吗?我当然可以检查
如果长度%3==0,但如何使用RE?
你想要一个非捕获组。在
(?:...)A non-capturing version of regular parentheses. Matches whatever regular expression is inside the parentheses, but the substring matched by the group cannot be retrieved after performing a match or referenced later in the pattern.
(?:...)
A non-capturing version of regular parentheses. Matches whatever regular expression is inside the parentheses, but the substring matched by the group cannot be retrieved after performing a match or referenced later in the pattern.
试试这个:
re.findall('TAA(?:[ATGC]{3})+?TAA' , seq)
你想要一个非捕获组。在
试试这个:
相关问题 更多 >
编程相关推荐