fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string str = @"[#URL^Url Description^#]";
  8. var regex = new Regex(@"^[^^]+\^([^^]+)\^[^^]+$");
  9. var result = regex.Replace(str, @"<a href=""some link"">$1</a>");
  10. Console.WriteLine(result);
  11. }
  12. }
Success #stdin #stdout 0.08s 34120KB
stdin
Standard input is empty
stdout
<a href="some link">Url Description</a>