A string maybe this
ipath= "./data/NCDC/上海/虹桥/9705626661750dat.txt"
or this
ipath = './data/NCDC/ciampino/6240476818161dat.txt'
How do I know the first string contains chinese?
I find this answer maybe helpful: Find all Chinese text in a string using Python and Regex
but it didn't work out:
import re
ipath= "./data/NCDC/上海/虹桥/9705626661750dat.txt"
re.findall(ur'[\u4e00-\u9fff]+', ipath) # => []
In python 3.6 i used this
The matched string should be unicode as well