1. 程式人生 > >正則表示式_擷取兩個字串中間的字串

正則表示式_擷取兩個字串中間的字串

 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;
            }