fork download
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.IO;
  5. using System.Text.RegularExpressions;
  6.  
  7. public class Test
  8. {
  9. public static void Main()
  10. {
  11. //var url = "http://w...content-available-to-author-only...e.com"; // http://w...content-available-to-author-only...e.com
  12. var url = "http://a...content-available-to-author-only...e.com";
  13. var domain_part = "www.";
  14. var regex = new Regex(string.Format(@"(^htt[^/]*//)(?!{0})(.*)", Regex.Escape(domain_part)));
  15. var res = regex.Replace(url, "$1" + domain_part + "$2");
  16. Console.WriteLine(res);
  17. }
  18.  
  19.  
  20. }
Success #stdin #stdout 0.1s 24688KB
stdin
Standard input is empty
stdout
http://w...content-available-to-author-only...e.com