gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 12:27:51 24 4
gpt4 key购买 nike

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

24 4 0
文章推荐: android - Android 上的嵌套 MVP : how to
文章推荐: python - 如何在终端中执行一行 python 脚本?
文章推荐: php -
文章推荐: c# - 加载一对多模型
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com