尝试以下操作:
var input = @"m\anoj ku\mar m\a\noj";
var pattern = new Regex(@"([a-z])\\");
var replaced = pattern.Replace(input, m => m.Groups[1].ToString().ToUpper());
Console.WriteLine(replaced);
更新
将数字映射到按移位的形式:
string text= @"m\an1oj ku\mar m\a\no9j";
char[] shiftPressForms = ")!@#$%^&*(".ToCharArray();
Regex pattern = new Regex(@"([a-z])\\");
Regex pattern_digit = new Regex(@"\d");
string replaced = pattern.Replace(text, m => m.Groups[1].ToString().ToUpper());
replaced = pattern_digit.Replace(replaced, m => shiftPressForms[int.Parse(m.Value)].ToString());
Console.WriteLine(replaced);