62,047
社区成员
发帖
与我相关
我的任务
分享
Regex reg = new Regex(@"(?i)id\s*=\s*[^\s,}]+");
//过客大哥 这个[^\s,}] 只不匹配 ,号不就可以么 为什么还要有\s和}啊!!!
string aa = "{ Id = 1a213baa-cac8-48d7-94a9-02cb55c312bd, Description = asdasddsffsdf, ItemNo = ItemNo3, BranchName = 228J0P, UM = UM, ABCCode = DDDDD, GLClass = GL002, CyclCountCategory = Phical cout, SupplierName = SUPPLIER3, Planner = PLANNER2, IssueType = , IssueMethod = FromBin, ReplenishQty = 3000, ShelfDays = 222, ReminderDays = 77777, LocationType = RFD, SupplierCode = SUPPLIER3, IsTracebility = False }";
Regex reg = new Regex(@"(?i)id\s*=\s*[^\s,}]+");
Match m = reg.Match(aa);
if (m.Success)
{
richTextBox2.Text = m.Value;
}
/*--------输出--------
Id = 1a213baa-cac8-48d7-94a9-02cb55c312bd
*/