一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

ubb代码转化html代码

时间:2022-06-30 11:20:30 编辑:袖梨 来源:一聚教程网

public static string UbbDecode(string str)
{
str = HtmlEncode(str);
str = Regex.Replace(str, @"[url](?.+?)[/url]", "${url}", RegexOptions.Compiled | RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"[url=(?.+?)](?.+?)[/url]", "${name}", RegexOptions.Compiled | RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"[email](?.+?)[/email]", "${email}", RegexOptions.Compiled | RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"[email=(?.+?)](?.+?)[/email]", "${name}", RegexOptions.Compiled | RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"[flash](?.+?)[/flash]", "", RegexOptions.Compiled | RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"[dir=(?[0-9]+?),(?[0-9]+?)](?.+?)[/dir]", "