C#正则用法两例
border="0" name="I1" align="middle" marginwidth="1" marginheight="1" src="http://www.b199.cn/blog_ads/Google_336_280.htm" frameborder="0" width="340" scrolling="no" height="282"> |
第一种用法:
--------------------------------------------------
string p=@"[a-z0-9]+";
Regex.Replace(schString , p , replaceString);
第二种用法:
--------------------------------------------------
Regex reg = new Regex(@"[a-z0-9]+");
reg.Replace(schString, replaceString)
border="0" name="I1" align="middle" marginwidth="1" marginheight="1" src="http://www.b199.cn/blog_ads/Google_468_60.htm" frameborder="0" width="470" scrolling="no" height="62">
border="0" name="I1" align="middle" marginwidth="1" marginheight="1" src="http://www.b199.cn/blog_ads/Google_ads_468_15.htm" frameborder="0" width="470" scrolling="no" height="18">
border="0" name="I1" align="middle" marginwidth="1" marginheight="1" src="http://www.b199.cn/blog_ads/Google_syndication_468_60.htm" frameborder="0" width="470" scrolling="no" height="62">
搜索其它相关资源,请用Google搜索:
border="0" name="I1" align="middle" marginwidth="1" marginheight="1" src="http://www.b199.cn/blog_ads/Google_search_40.htm" frameborder="0" width="460" scrolling="no" height="40">