正则表达式_截取两个字符串中间的字符串

 static string GetValue(string str, string s, string e)
            {
                Regex rg = new Regex("(?<=(" + s + "))[.\\s\\S]*?(?=(" + e + "))", RegexOptions.Multiline | RegexOptions.Singleline);
                return rg.Match(str).Value;
            }

猜你喜欢

转载自blog.csdn.net/weixin_39235487/article/details/80683347