private List<string> getURLFromContent(string content)
        {
            string regexStr = @"(http|ftp|https):\/\/[\w]+(.[\w]+)([\w\-\.,@?・^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])";           

            System.Text.RegularExpressions.MatchCollection mc = System.Text.RegularExpressions.Regex.Matches(content, regexStr,               System.Text.RegularExpressions.RegexOptions.IgnoreCase);

            List<string> urlStr = new List<string>();
            for (int i = 0; i < mc.Count; i++)
            {
                if(!urlStr.Contains(mc[i].ToString()))
                {
                    urlStr.Add(mc[i].ToString());
                }
            }
            return urlStr;
        }

相关文章:

  • 2022-12-23
  • 2021-12-19
  • 2021-11-17
  • 2022-12-23
  • 2021-08-19
  • 2021-07-23
  • 2022-02-05
猜你喜欢
  • 2021-10-29
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
  • 2022-12-23
  • 2021-11-29
相关资源
相似解决方案