111,094
社区成员




Regex regex = new Regex(@"(?<=\b[a-z]+\b)\s(?=\b(?:d|ll|m|re|s)\b)", RegexOptions.IgnoreCase);
Console.WriteLine(regex.Replace("I m the first VIP and you ll be VIP, too. So we re all VIPs. I d like to tell you what s up.", "'"));
regex = new Regex(@"\bxml:lang=(?<langCtry>""[^""]+""|'[^']+')", RegexOptions.IgnoreCase);
Console.WriteLine(regex.Replace("<speak version='1.0' xmlns='http://www.w3.org/2001/10/synthesis' xmlns:mstts='http://www.w3.org/2001/mstts' xmlns:emo='http://www.w3.org/2009/10/emotionml' xml:lang='en-us'>", "--${langCtry}--"));
// 自己稍微组织一下,就可以了。
Regex reg = new Regex(@"(?<=xml:lang=)(['""]?)(?<lan>[^'""]+)\1");
Console.WriteLine(reg.Match(str).Groups["lan"].Value);