What i want to do is split a line such as >m27348020>m8918930
into a list in this format ['>m27348020', '>m8911830]
Is there any way to do this using re.split? The split would happen at the > symbol.
Instead of split you can easily do
import re
x=">m27348020>m8918930"
print re.findall(r">[^>]*",x)
You may simply split the string on the given separator and then simply concatenate the separator at the start of each split element.
separator = ">"
line = ">m27348020>m8918930"
print [separator+i for i in line.split(separator) if len(i)>0]
>>> ['>m27348020', '>m8918930']