url提取方法
- 作者:xiaoxiao
- 发表时间:2020-12-23 10:35
- 来源:未知
public static ArrayList GetLinks(string htmlContent) { Match mMatch; ArrayList aMatch = new ArrayList(); mMatch = Regex.Match(htmlContent, "href//s*=//s*(?:/"(?<1>[^/"|^/']*)/"|/'(?<1>[^/']*)/'|(?<1>[^>|^ ]*))", RegexOptions.IgnoreCase|RegexOptions.Compiled); while(mMatch.Success) { aMatch.Add(mMatch.Groups[1].ToString()); mMatch = mMatch.NextMatch(); } return aMatch; }