fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text.RegularExpressions;
  6.  
  7. public class Test
  8. {
  9. public static void Main()
  10. {
  11. var text = "[MYLINK ID=\"1234\" URL=\"http://m...content-available-to-author-only...e.com\" TEXT=\"Website link\"]";
  12. var pattern = "\\[MYLINK\\s+ID=\"([^\"]*)\"\\s+URL=\"([^\"]*)\"\\s+TEXT=\"([^\"]*)\"]";
  13. var replacement = "<a href=\"$2?id=$1\">$3</a>";
  14. var result = Regex.Replace(text, pattern, replacement, RegexOptions.IgnoreCase);
  15. Console.WriteLine(result);
  16. }
  17. }
Success #stdin #stdout 0.08s 27140KB
stdin
Standard input is empty
stdout
<a href="http://m...content-available-to-author-only...e.com?id=1234">Website link</a>