I am using this regex patttern in python:
'("CDS)(complement)?(\()?(join)?([\(]?[<]?[0-9]{0,6}[.]{0,2}[>]?[0-9]{0,6}[,]?[\)]{0,2})*(/locus_tag=)(["])([^"]*)(["])'
To find things in a file, like this:
"CDScomplement(join(169314..169361,169451..169552,169635..169690,169833..169937,170056..170125,170277..170518,170640..170841,170968..171090,171191..171263,171387..171508))/locus_tag="MAL1P1.24"
But there is something strange, because when I use re.finditer and use a for
loop and print(matchobject.group(0))
, I can see that every matchobject group completely matches matches. But when I use print(matchobject.groups())
or print(matchobject.group(5))
it returns an empty string. What's going on?