如何转换[b]xxx[/b]
为<strong>xxx</strong>
使用 VB.NET Regex.Replace()?
谢谢。
如何转换[b]xxx[/b]
为<strong>xxx</strong>
使用 VB.NET Regex.Replace()?
谢谢。
只需使用其他人编写的BBCode 解析器即可。它更安全、更健壮。
Regex.Replace("\[b\](.*?)\[\/b\]", "<strong>$1</strong>")
会做的
但是,您不需要正则表达式:
"[b]xxx[/b]".Replace("[b]","<strong>").Replace("[/b]","</strong>")