I have been trying to extract the particular substring from multiple lines in Python.
The string goes for 400 lines...with foreign characters as well(for instance Chinese)
The example is my_string = '''\n1. Up in the air: 悬而未决\n2. Out of the woods: 摆脱困境\n3. Not all there: 智商掉线\n'''
all the way to 400. Born to the purple: 出身显赫.
What I want to do: Extract only the English part and put them in a list
[Up in the air, Out of the woods, Not all there]
Here is my way of doing it.
import re
my_list = re.split('\:.*\n',my_string[1:])
for line in my_list[-1]:
olist = re.sub('\d.','',line)
print (olist)
Is that possible to do this in one line?
Thank you