
正则表达式
friendan
快乐源于分享丶
展开
-
C#正则表达式之字符替换!...
string strTest= "www.BaiDu.com",strRst=""; //忽略大小写,将strTest中的BaiDu替换为baidu Regex myRegex = new Regex("baidu",RegexOptions.IgnoreCase); strRst=myRegex.Replace(strTe原创 2012-04-11 21:39:40 · 8582 阅读 · 0 评论 -
C#正则表达式之查找特定的字符!...
效果截图如下 : 主要代码如下: static void Main(string[] args) { string strTest1 = "{正则表达式-小试牛刀 By yxHuang!...}"; string strTest2 = "{微软、谷歌、百度}"; string s原创 2012-04-11 20:00:50 · 5309 阅读 · 0 评论 -
C#之判断字符串是否以187开头 By -->正则表达式!...
//元字符^匹配字符串的开始(^和数字6在同一个键位上的符号) string strTest = "18777611xxx"; //正则表达式 string strExp = @"^187"; //创建正则表达式对象 Regex myRegex =原创 2012-04-12 22:38:45 · 4030 阅读 · 1 评论 -
C#正则表达式之过滤掉双引号...
String title="Test\""; //将title中的双引号替换为问号 title=Regex.Replace(title,@"[\""]+","?");原创 2012-05-29 16:44:26 · 8142 阅读 · 0 评论