Home
Sign Up
Sign In
V2EX
›
问与答
请教关于正则匹配的问题
paloalto
·
Sep 16, 2010
· 4937 views
This topic created in 5897 days ago, the information mentioned may be changed or developed.
小弟以前没学过写代码,后来google了一下发现
[^\x00-\xff]用来匹配中文
[a-zA-Z0-9]用来匹配英文和数字
如果需要同时匹配中文、英文、数字,代码该怎么写呢?
匹配
中文
英文
1 replies
•
1970-01-01 08:00:00 +08:00
fay
Sep 16, 2010
1
[^\x00-\xff]这个严格来说不是匹配中文,而是排除ascii码为0-255的字符(就是西文字符)以外的多字节字符,例如中文、日文、韩文。你可以想想哪些字符不需要匹配,然后用^来解决。
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
595 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 26ms ·
UTC 18:58
·
PVG 02:58
·
LAX 10:58
·
JFK 13:58
♥ Do have faith in what you're doing.
❯