从<a href="" using="" using="" regex="" c#=""

时间:2019-05-06 16:59:20

标签: c# html regex

="" I am dynamically getting the <a href from salesforce so the url is different every time

example of what i am pulling from salesforce:

<a href="https://test.com" target="_blank">click here</a>

i need to pull: https://test.com

中提取网址

这就是我所拥有的,但是我的字符串re并没有拉出url,而是拉出了所有内容:<a href="https://test.com" target="_blank">click here</a>

string Link = SforceUtil.GetValue(object, "apiname");
   string re = Regex.Match(Link,"href\\s*=\\s*\"( <url>.*?)\"").Groups["url"].Value;
  Response.Redirect(re);

这是在我的私人空白提交中。

0 个答案:

没有答案