正则表达式问题 -- 如何匹配全角汉字

whyxx 2004-07-14 10:55:25
我知道可以用unicode或ASCII码进行,但不知道应该怎么写,哪位大哥知道,帮忙写一个.谢了.
...全文
180 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
cnblackhawk 2004-09-23
  • 打赏
  • 举报
回复
whyxx 2004-07-14
  • 打赏
  • 举报
回复
谢谢,中文我知道了,那日文全角的unicode范围是什么呢?
xjliang007 2004-07-14
  • 打赏
  • 举报
回复
XX
AntingZ 2004-07-14
  • 打赏
  • 举报
回复
Dim reg As System.Text.RegularExpressions.Regex
Dim strPattern As String = "[\u4e00-\u9fa5]"
If reg.IsMatch(Me.TextBox1.Text, strPattern) = True Then
MsgBox("有汉字")
Else
MsgBox("没汉字")
End If

strPattern = "[^\x00-\x7F]"
If reg.IsMatch(Me.TextBox1.Text, strPattern) = True Then
MsgBox("有全角字符")
Else
MsgBox("有全角字符")
End If
webmasterss 2004-07-14
  • 打赏
  • 举报
回复
Regex r= new Regex(@"[\u4e00-\u9fa5]+");
MatchCollection m=r.Match(yourstring);
moonewxp 2004-07-14
  • 打赏
  • 举报
回复
汉字还有半角的?

16,554

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧