正则表达式韩语日语

时间:2021-09-17 15:56:30
# -*- coding:utf-8 -*-

import re

korean = u'崔雪莉(최진리)'

line = [u'x', u'y', u'z', u'쭌', u'a']

if any([re.search(u'[\uAC00-\uD7A3]', x) for x in line[3:]]):
    print "found character"

#[\uAC00-\uD7A3]基本包括所有的韩文,https://en.wikipedia.org/wiki/Template:Unicode_chart_Hangul_Syllables
print re.sub(u'[\uAC00-\uD7A3]+','',korean)

japan = u"不二周助ふじしゅうすけ"

print re.sub(u'[\u0800-\u4e00]+','',japan)