How can I convert [b]xxx[/b]
to <strong>xxx</strong>
using VB.NET Regex.Replace()?
Thanks.
How can I convert [b]xxx[/b]
to <strong>xxx</strong>
using VB.NET Regex.Replace()?
Thanks.
Just use a BBCode parser that someone else has written. It’s safer and more robust.
Regex.Replace("\[b\](.*?)\[\/b\]", "<strong>$1</strong>")
would do it
However, you don't need regex:
"[b]xxx[/b]".Replace("[b]","<strong>").Replace("[/b]","</strong>")