Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/313.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python字符串拆分返回奇怪的字符_Python_Python 3.x - Fatal编程技术网

Python字符串拆分返回奇怪的字符

Python字符串拆分返回奇怪的字符,python,python-3.x,Python,Python 3.x,我想从这个字符串中获取4月28日的日期。如果我拆分字符串,它将生成如下输出 string = '''In your opinion, will BCH/USD trade above 1500 USD (+9.65%) at anу timе bеfore Арril 28? Indicаtоr: 60.76%''' splited = string.split() print(splited) # Using Regex import re res = re.findall(r"\w+

我想从这个字符串中获取4月28日的日期。如果我拆分字符串,它将生成如下输出

string = '''In your opinion, will BCH/USD trade above 1500 USD (+9.65%) at anу timе bеfore Арril 28?
Indicаtоr: 60.76%'''

splited = string.split()
print(splited)

# Using Regex
import re 

res = re.findall(r"\w+ \d+\?", string)
print(res)
如果我使用正则表达式,它只返回

an\xd1\x83', 'tim\xd0\xb5', 'b\xd0\xb5fore', '\xd0\x90\xd1\x80ril', '28?
如何获取日期或转换字符串,使其像普通字符串一样工作


这些奇怪的字符不是拉丁字符

例如,“anö”一词中的Y实际上是西里尔字母小写的У,而“АПril”一词包含西里尔字母А和西里尔字母小写的П


然而,在相当多的计算机字体中,这些字符看起来与拉丁字符完全相同,你只是被这些西里尔字母弄糊涂了。

有点颠倒,因为副本实际上是原始问题(现已关闭/删除)的副本。请参阅副本中的第一条注释。怪异的世界。
$charinfo'anö'
U+0061拉丁小写字母A[Ll]
U+006E拉丁小写字母N[Ll]
U+0443西里尔字母U[Ll]
ril 28