C# 利用正规表达式,读取Discuz帖子中的附件

利用正规表达式,读取Discuz帖子中的附件,思路如下:

var rg = new Regex(@"(?<=\[attach\]).*?(?=\[/attach\])");
var mMatchCollection = rg.Matches(mContent);
for (var j = 0; j < mMatchCollection.Count; j++)
{  

  var sSql = "select attachment from cdb_attachments where aid="+mMatchCollection[j].Value;

}

原文地址:https://www.cnblogs.com/chendaoyin/p/2973969.html