I am using Python and I would like to split the following string:
string = '小西 - 杏花 Siu Sai - Heng Fa'
I would like to split the string that could give me 小西 - 杏花 and Siu Sai - Heng Fa. I tried different ways and still couldn’t split the string properly.
Thanks in advance
>Solution :
One of the option is just to split before the first English character and take the 1st and 2nd group
inputstring = '小西 - 杏花 Siu Sai - Heng Fa'
a = re.split(r'([a-zA-Z].*)', inputstring)
>>>['小西 - 杏花 ', 'Siu Sai - Heng Fa', '']