110,536
社区成员
发帖
与我相关
我的任务
分享
string sql = "select divide_id,create_date,divide_amount from income_divide where #divide_id# and #create_date#";
MatchCollection matchs = Regex.Matches(sql, @"(?<=#)[^# ]+(?=#)");
foreach (Match match in matchs)
{
textBox1.Text += match.Value + "\r\n";
}
(?<=#)\w.*?(?=#)
void Main()
{
string str=@"string sql = ""select divide_id,create_date,divide_amount from income_divide where #divide_id# and #create_date#"";";
foreach(Match m in Regex.Matches(str,@"(?<=#)[^#\s]+(?=#)"))
{
Console.WriteLine(m.Value);
}
/*
divide_id
create_date
*/
}