fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string str = @"....href=""http://m...content-available-to-author-only...r.com"" href=""www.foo.mynewsite.humbler.com"" foo bar href=""http://m...content-available-to-author-only...e.com"" ";
  9. string result = Regex.Replace(str, @"(?<=(https?://)?(www\.)?(\S+?\.)?mynewsite(\.\S+?)?)\.com", ".net");
  10. Console.WriteLine(result);
  11. Console.ReadLine();
  12. }
  13. }
Success #stdin #stdout 0.07s 34184KB
stdin
Standard input is empty
stdout
....href="http://m...content-available-to-author-only...r.net" href="www.foo.mynewsite.humbler.net" foo bar href="http://m...content-available-to-author-only...e.net"