62,272
社区成员
发帖
与我相关
我的任务
分享string[] items = Regex.Split(html,@"(?is)\[img\].+?\[/img\]");
using System.Text.RegularExpressions;
Regex regex = new Regex(
@"(?<=\[img\])([\s\S]*?)(?=\[/img\])",
RegexOptions.IgnoreCase
);
public static string LostHTML(string Str)
{
string Re_Str = "";
if (Str != null)
{
if (Str != string.Empty)
{
string Pattern = @"[img][\s\S]*?[/img]";
Re_Str = Regex.Replace(Str, Pattern,"");
}
}
return (Re_Str.Replace(" \\r\\n", "")).Replace("\\r", "").Replace("\r", "").Replace("\n", "");
}