求个正则表达式

kenwbz 2005-10-21 02:14:36
是这样的 我想已流的方式读出html保存到 strResult 在html里找到所有和已strurlmiddle开头已>结尾的字符串
程序如下 调式的时候都有值 strmiddle和 strresult
把调式的strmiddle手工在strResult可以找到11个 符合的字符串 但是程序找不到
应该是正则表达式不对了
我是用C# 开发 winform
String pattern= "" + strurlmiddle + "[^>]*/";


Regex r=new Regex(pattern,RegexOptions.IgnoreCase | RegexOptions.Compiled);



MatchCollection matches=r.Matches(strResult);
Console.WriteLine("Number of groups found = " + matches.Count);
foreach( Match m in matches)
{
string sv = m.Groups[1].Value;
}
...全文
95 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
jimh 2005-10-21
  • 打赏
  • 举报
回复
String pattern= "" + strurlmiddle + "[^>]*";
string sv = m.Groups[0].Value;
zhujiechang 2005-10-21
  • 打赏
  • 举报
回复
"trurlmiddle.*>"

110,566

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧