在 Python 3.3 中,我想匹配下面的模式,但总是失败。
摄氏零下253
我使用了下面的正则表达式。
[^\x00-\x47\x58-\x7F]+
它不是排除了除数字以外的所有ascii吗?
最佳答案
根据您使用的编程语言,您可以使用以下内容。
[\p{Han}\p{N}]+
\p{Han}
matches characters in the Han script.
\p{N}
matches any kind of numeric character in any script.
关于python - 在 Python 中匹配 "Chinese+Number"模式的正则表达式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24522394/