python - 在 Python 中匹配 "Chinese+Number"模式的正则表达式

标签 python regex

在 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.

Live Demo

关于python - 在 Python 中匹配 "Chinese+Number"模式的正则表达式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24522394/

相关文章:

java - 正则表达式 String.split( )

regex - Vim 正则表达式搜索与替代方案

regex - 用于 Semver 匹配的 GNU grep 正则表达式

Python sqlalchemy 调用存储过程

python - 在/image/expected string 或 Unicode 对象处出现 TypeError,InMemoryUploadedFile 已找到

执行之间的python多处理 sleep

python - 如何删除特定索引的行?

用于查找字符串中所有单词的 Python 正则表达式

javascript - 在javascript中检查字符串是否为字母数字

python - PyQt4 - 小部件未显示