是否有一个正则表达式可以从下面的字符串中给我一个名称值对,如下所示:
状态码 = 179640000 
new_Approved = 179640002  
从:
&$filter=statuscode/Value eq 179640000 and new_Approved/Value eq 179640000
示例程序:
    public static void Main()
    {
        string src = "&$filter=statuscode/Value eq 179640000 and new_Approved/Value eq 179640000";
        Regex regex = new Regex(@"(\w*)/Value eq (\w*)");
        foreach (Match m in regex.Matches(src))
        {
            foreach (Group g in m.Groups)
            {
                Console.WriteLine(g.Value);
            }
        }
    }
给出以下输出
statuscode/Value eq 179640000
statuscode
179640000
new_Approved/Value eq 179640000
new_Approved
179640000
Press any key to continue . . .
您在比赛中为每个组所拥有的是:
它假定所有名称和值都只是字母数字和'_',它还假定您的源字符串没有其他曲线球。  
^&filter=({[0-9a-zA-Z]+}/Value eq {[0-9a-zA-Z]+})( and )?)$
我认为这可以作为一个通用模板。您需要稍微修改语法以使用您正在使用的任何正则表达式引擎。