I have strings of the following form:
}# => 2[1 HMDB00001 ,2 HMDB00002]
}# => 5[1 HMDB00001 ,2 HMDB00002, 3 HMDB00003 ,4 HMDB00004,5 HMDB00005]
}# => 1[1 HMDB00001]
in a .txt file. I am trying to parse them in python lists using the re.search() with regular expressions, but so far unsuccessful. As u can guess the list should contain elements as follows elements = ["1 HMDB00001", "2 HMDB00002", "3 HMDB00003"]. Lists are independent from each other. So, when parsing only one line can be taken in consideration (eg. }# => 2[1 HMDB00001 ,2 HMDB00002]).