public static String AutoNoFollow(string strVar, string param) { string final = Regex.Replace(strVar, @"(?<anchor><\s*a\s*)", "<a rel=\"nofollow\" " + (param == String.Empty ? "" : param + " ")); return final; }