最新下载
热门教程
- 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,''))"
相关文章
- AllUnity获得德国联邦金融监管局(BaFin)许可,将推出德国首个符合MiCAR标准的欧元稳定币 07-09
- 代号宗师新手前期玩法攻略分享 07-09
- 龙石战争治疗队玩法搭配介绍说明 07-09
- 端午佳句子72句 07-09
- 燕云十六声飞天舞乐兔怎么收集-飞天舞乐兔获取及位置攻略 07-09
- 新三国志曹操传洪水救人关卡攻略 07-09