1.img标签
//<img开头,中间不包含<或>,空格后src以‘或"开始.....
Regex reg = new Regex("<img[^<>]*\\ssrc=([‘\"]+[^<>‘\"]+[‘\"]+)[^<>]*>", RegexOptions.IgnoreCase);
MatchCollection mc = reg.Matches(html);
foreach (Match m in mc)
{
var src= m.Groups[1].Value;
}
2.textarea标签内容
string text = "<textarea id=‘ta1‘ .*>111</textarea>";// this.txt_RplayContenet.Text;
Regex reg = new Regex("<textarea id=‘(.+)‘ .*>(.*)</textarea>", RegexOptions.IgnoreCase);
var match=reg.Match(text);
if (match.Success)
{
var id = match.Groups[1].Value; //ta //括号分组,默认正则匹配到的字符串是group[0],第一个括号group[1],第二个括号group[2]
var content = match.Groups[2].Value; //111
}