Console.WriteLine();
pattern = "mr [A-Z][a-z]*";
str = "%mr Jhons@!";
regex = new Regex(pattern);
ouputStr = regex.Replace(str, "$_");//把找到的匹配使用整个的字符串,也就是str的值来替换
Console.WriteLine(ouputStr);
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did65338