随笔分类 - 正则表达式
摘要:匹配中文字符的正则表达式: [\u4e00-\u9fa5] 匹配双字节字符(包括汉字在内):[^\x00-\xff] 应用:计算字符串的长度(一个双字节字符长度计2,ASCII字符计1) String.prototype.len=function(){return this.replace([^\x00-\xff]/g,"aa").length;} 匹配空行的正则表达式:\n[\s| ]*\r ...
阅读全文
摘要:Power Maintenance Tools -- By Alai [http://www.9499.net] 高级查找/替换、正则表达式练习器、Javascript脚本程序调试器 查询表达式: 替换为: ...
阅读全文

浙公网安备 33010602011771号