*****正则表达式问题 <item class='person' operate='121' />如何使用正则表达式提取operate中的内容要求结果是:121注:使用substring+indexOf的兄弟们勿扰 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Regex reg = new Regex(@"'(? <operate>\d*)'",RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);string operate = reg.Match("<item class='person' operate='121' /> ").Groups["operate"].Value; string yourStr = ......;Match m = Regex.Match(yourStr, @"<item\s+class=.+?\s+operate='(.+?)'\s+/>");m.Groups[1].Value; string ss = "<item class='person' operate='121' /> ";ss = Regex.Match(ss, @"operate='([^']+)'").Groups[1].ToString();Console.WriteLine(ss);/*121请按任意键继续. . .*/ Help & Manual 制作的用户手册图片显示问题 多线程创建和访问的问题,请高手指教! 验证码控件如何比较? VS2008的C#中的get set 作何用? 关于datagridview的错误--没有要访问的 Original 数据 请教dongdingbaihe大哥。。。 想了好几天了!请大家帮忙出个主意 求助!C#后台静默下载 GridView动态表头,其中含有控件,如何换行 小问题:richTextBox中输出的文字 将一个数组中的部分数据复制到另一个数组中 有现成的接口函数吗 请帮我把这段代码翻译成C++的
Regex reg = new Regex(@"'(? <operate>\d*)'",RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);
string operate = reg.Match("<item class='person' operate='121' /> ").Groups["operate"].Value;
Match m = Regex.Match(yourStr, @"<item\s+class=.+?\s+operate='(.+?)'\s+/>");
m.Groups[1].Value;
ss = Regex.Match(ss, @"operate='([^']+)'").Groups[1].ToString();
Console.WriteLine(ss);
/*
121
请按任意键继续. . .
*/