1 /// <summary> 2 /// 获得字符串中开始和结束字符串中间得值 3 /// </summary> 4 /// <param name="str">字符串</param> 5 /// <param name="s">开始</param> 6 /// <param name="e">结束</param> 7 /// <returns></returns> 8 public static string GetValue(string str, string s, string e) 9 { 10 Regex rg = new Regex("(?<=(" + s + "))[.\s\S]*?(?=(" + e + "))", RegexOptions.Multiline | RegexOptions.Singleline); 11 return rg.Match(str).Value; 12 }