string text = "select * from [admin] where aa=1 and cc='b' order by aa desc ";
Regex reg = null;
reg = new Regex(@"s+froms+.*?(s+wheres+|s+orders+|s+groups+)|s+froms+.+", RegexOptions.IgnoreCase);
string table = reg.Match(text).Value;
table = Regex.Replace(table.ToLower(), @"s+froms+|s+wheres+|[|]|s+orders+|s+groups+", "");
reg = new Regex(@"selects+.*?s+froms+", RegexOptions.IgnoreCase);
string field = reg.Match(text).Value;
field = Regex.Replace(field.ToLower(), @"selects+|s+froms+|[|]", "");
reg = new Regex(@"s+wheres+.*?(s+orders+|s+groups+)|s+wheres+.+", RegexOptions.IgnoreCase);
string condition = reg.Match(text).Value;
condition = Regex.Replace(condition.ToLower(), @"s+wheres+|s+orders+|s+groups+|[|]", "");
reg = new Regex(@"s+orders+bys+.*?s(desc|asc)|s+orders+bys+.*?s", RegexOptions.IgnoreCase);
string order = reg.Match(text).Value;
order = Regex.Replace(order.ToLower(),@"s+orders+bys+|[|]", "");