例如:从数据中获取content字符串,这个content用于前台html的显示,content中包含多个<img src="_IIMMGG_2156537">,_IIMMGG_后面的数字是imageid,每个img标签的id各不相同,如何获取content中各_IIMMGG_后面的imageid呢?

--解决方案

string tmp = this.m_PropContent;
Regex RX = new Regex(@"_IIMMGG_\-?\d+", RegexOptions.Compiled);
MatchCollection match = RX.Matches(tmp,0);
string imageId = "";

foreach(Match ma in match)
{
string strValue= ma.Value;
string strId = strValue.Replace("_IIMMGG_","");
imageId+= strId+",";
}

 

相关文章:

  • 2022-01-08
  • 2021-08-21
  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-04
猜你喜欢
  • 2021-06-30
  • 2023-03-19
  • 2021-06-26
  • 2022-03-11
  • 2021-10-30
  • 2022-12-23
相关资源
相似解决方案