62,047
社区成员
发帖
与我相关
我的任务
分享
string strs = "[AA:BB AA:Sql=\"select top 1 ddd,eee,fff,ggg from Tabel\" ] [/AA:BB]";
Regex r = new Regex("(?is)(?<=Sql=\")(?:(?!</?\").)*(?=\")", RegexOptions.Compiled | RegexOptions.IgnoreCase);
foreach (Match m in r.Matches(strs))
{
foreach (Capture c in m.Captures)
{
string sql = c.Value;
}
}