Reputation: 103348
How can I convert [b]xxx[/b]
to <strong>xxx</strong>
using VB.NET Regex.Replace()?
Thanks.
Upvotes: 3
Views: 3106
Reputation: 7846
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>")
Upvotes: 6
Reputation: 177594
Just use a BBCode parser that someone else has written. It’s safer and more robust.
Upvotes: 7