How to remove BBCode from string in .Net
1 answer
Your regex looks like it won't work, so I tried something else:
string s = "[url]www.google.com[/url] [url=www.google.com]www.google.com[/url]";
s = Regex.Replace(s, @"\[[^]]+\]", "");
Result:
www.google.com www.google.com
Also, you will need this instruction located at the top of the file to make this work:
using System.Text.RegularExpressions;
+2
a source to share