Can anyone help me write a regex have below result to replace bbcode with html tag, for here i want to replace [b][/b] with <strong></strong>
So this:
"fsdfs [b]abc[/b] dddfs [b]abc[/b] fdsfdsfs [b]abcfsdfs"
Becomes:
"fsdfs <strong>abc</strong> dddfs <strong>abc</strong> fdsfdsfs [b]abcfsdfs"
Would the following Regex help to solve this problem?
string result = Regex.Replace(s, @"\[b\](.*?)\[\/b\]", @"\<stront\>(.*?)\<\/strong\>");
<stront\>should probably be<strong\>what ever you try to do."fsdfs [b]abc[/b] dddfs [b]abc[/b] fdsfdsfs [b]abcfsdfs"to"fsdfs <strong>abc</strong> dddfs <strong>abc</strong> fdsfdsfs [b]abcfsdfs"with regex. Putting both the input and output on the same line was an unfortunate choice.