好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

c#正则表达式替换实例及语法

Console.WriteLine();

pattern = "mr [A-Z][a-z]*";

str = "%mr Jhons@!";

regex = new Regex(pattern);

ouputStr = regex.Replace(str, "$_");//把找到的匹配使用整个的字符串,也就是str的值来替换

Console.WriteLine(ouputStr);

查看更多关于c#正则表达式替换实例及语法的详细内容...

  阅读:78次