fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. Console.WriteLine(Regex.Replace("<tag tsdfg> some random text", @"<(.*)?\s+(.*)?>", "<$1>"));
  9. Console.WriteLine(Regex.Replace("<tag tsdfg /> some random text", @"<(.*)?\s+(.*)?>", "<$1>"));
  10. }
  11. }
Success #stdin #stdout 0.08s 24544KB
stdin
Standard input is empty
stdout
<tag> some random text
<tag tsdfg> some random text