fork(2) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string s = "fsdfs [b]abc[/b] dddfs [b]abc[/b] fdsfdsfs [b]abcfsdfs";
  9. string result = Regex.Replace(s, @"\[b\](.*?)\[/b\]", @"<strong>$1</strong>");
  10. Console.WriteLine(result);
  11. }
  12. }
Success #stdin #stdout 0.08s 34096KB
stdin
Standard input is empty
stdout
fsdfs <strong>abc</strong> dddfs <strong>abc</strong> fdsfdsfs [b]abcfsdfs