Python Regex搜索中文/日语字符

2024-05-21 04:45:16 发布

您现在位置:Python中文网/ 问答频道 /正文

除了使用Unicode模式(http://xahlee.org/perl-python/regex_split.html)在Python中搜索中文/日文字符时,是否可以在不区分大小写或敏感模式下搜索所述字符?(回复一)

我想弄明白为什么下面的方法不起作用:

mystring = 你是我
found    = re.search(你是我, mystring, re.I)
found    = re.search(你是我, mystring)

Tags: orgrehttpsearchhtmlunicode模式字符