string = 'protein219 Info=Acidfast Name="Mycobacterium smegmatis" pcp=36789'
I would like to split the string ignoring the whitespaces between "" . I am using the below regex to split the line
mystring = [s for s in re.split("( |\\\".*?\\\"|'.*?')", mystring) if s.strip()]
Which gives me the result as
['protein219', 'Info=Acidfast', 'Name=' , '"Mycobacterium smegmatis"', 'pcp=','36789']
Expected Output:
['protein219', 'Info=Acidfast', 'Name="Mycobacterium smegmatis"',' pcp=36789']
please provide your suggestion