跪求正则表达式一个 <span class="g"> www.doc88.com/提取:www.doc88.com跪求了! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string inputstring = "<span class=\"g\">www.doc88.com/"; string pattern = "<span class=\"g\">"; string replacement = ""; inputstring = System.Text.RegularExpressions.Regex.Replace(inputstring, pattern, replacement).Replace("/",""); string test = @"<span class=""g""> www.doc88.com/"; string pattern = @"(?i)<span[^>]*?class=(['""]?)g\1[^>]*?>\s*?((http://)?.*?\.com)"; string href = Regex.Match(test, pattern).Groups[2].Value; // www.doc88.com 兄弟你这个很给力确实管用但是我抓取:http://www.baidu.com/s?wd=site%3Agov.cn显示确实是这样的跪求帮忙看看代码:Regex reg = new Regex(@"(?i)<span[^>]*?class=(['""]?)g\1[^>]*?>\s*?((http://)?.*?\.com)"); MatchCollection mc = reg.Matches(thecode); foreach (Match m in mc) { richTextBox1.Text += m.Groups[2].Value+ "\n"; } Trystring pattern = @"(?i)<span[^>]*?class=(['""]?)g\1[^>]*?>\s*?((http://)?[^/\s<>]+)"; 选择文件路径对话框 跪求一个小程序的写法 DataGrid如果绑定到数组? 请问一个关于C# 语法的基本问题 关于RadioButtonList的问题! 如何避免copy文件冲突 有关Microsoft Visual Studio .NET 属性窗口的问题(控件) 请教主窗体与子窗体的设置 请来个高手帮我把这两个方法转成函数,谢谢拉 关于web.net中错误的处理…… comboBox1_SelectedIndexChanged事件 这个vb.net代码(几行用来递归搜索文件的代码)翻译成c#报错,要怎么改呢?
string inputstring = "<span class=\"g\">www.doc88.com/";
string pattern = "<span class=\"g\">";
string replacement = "";
inputstring = System.Text.RegularExpressions.Regex.Replace(inputstring, pattern, replacement).Replace("/","");
string pattern = @"(?i)<span[^>]*?class=(['""]?)g\1[^>]*?>\s*?((http://)?.*?\.com)";
string href = Regex.Match(test, pattern).Groups[2].Value;
// www.doc88.com
你这个很给力
确实管用但是我抓取:http://www.baidu.com/s?wd=site%3Agov.cn
显示确实是这样的
跪求帮忙看看代码:Regex reg = new Regex(@"(?i)<span[^>]*?class=(['""]?)g\1[^>]*?>\s*?((http://)?.*?\.com)");
MatchCollection mc = reg.Matches(thecode);
foreach (Match m in mc)
{
richTextBox1.Text += m.Groups[2].Value+ "\n";
}
string pattern = @"(?i)<span[^>]*?class=(['""]?)g\1[^>]*?>\s*?((http://)?[^/\s<>]+)";