最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp.net C# 匹配双字节字符(包括汉字)
时间:2022-06-25 05:03:14 编辑:袖梨 来源:一聚教程网
匹配双字节字符(包括汉字)
[^x00-xff]
匹配中文字符的正则表达式: [u4e00-u9fa5]
class class1
{
static void main()
{
string s = "中文 chinese";
regex regx = new regex("[u4e00-u9fa5]+");
match m = regx.match(s);
console.writeline(m.groups教程[0].value); // 中文
console.readkey();
}
}
js
用正则表达式限制只能输入中文:
onkeyup="value=value.replace(/[^u4e00-u9fa5]/g,'')" onbeforepaste="clipboarddata.setdata('text',clipboarddata.getdata('text').replace(/[^u4e00-u9fa5]/g,''))"
相关文章
- 我的花园世界合种怎么组队 08-26
- 逆水寒手游育宠及新宠物有哪些内容 08-26
- 赛尔号巅峰之战索伦森关卡怎么通关 08-26
- 物华弥新鸟音山水钟有什么玩法技巧 08-26
- 米姆米姆哈怎么培养闪闪立羽鸮 08-26
- 光隙解语奶妈如何选择 08-26