摘要: 添加引用:using System.Text.RegularExpressions;使用举例程序代码: 1 //初始化字符串 2 string str =this.txtSource.Text; 3 //定义正则表达式规则 4 Regex reg = new Regex("[a-zA-Z]+"); 5 //返回一个结果集 6 MatchCollection result = reg.Matches(str); 7 //遍历每个结果 8 foreach (Match m in result) 9 ... 阅读全文
posted @ 2013-10-24 18:46 代码小兵 阅读(25818) 评论(0) 推荐(0) 编辑