.value = "00e4a" + "92212" + "90799" + "497";怎么获取结果为  00e4a9221290799497  呢?

解决方案 »

  1.   

    没看出来和正则有什么关系呀?
    value是string类型吗?
    结果要求什么类型?
      

  2.   

    只需要`结果获取为` 00e4a9221290799497  这样的规则就OK拉  那么晚都在啊?谢谢拉
      

  3.   

    string value = "00e4a" + "92212" + "90799" + "497";
    这个结果不就是00e4a9221290799497 
    还要怎么获取?没看明白
      

  4.   

    代码是value = "00e4a" + "92212" + "90799" + "497";我需要!用规则获取成为00e4a9221290799497 连起来的拉!我太白了`不好意思
      

  5.   

    MatchCollection mc = Regex.Matches(@".value = ""00e4a"" + ""92212"" + ""90799"" + ""497"";",@"""(.+?)""");
    foreach(Match m in mc)
    {
        m.Value;//就是结果
    }
      

  6.   

    public static void Test()
    {
        MatchCollection mc = Regex.Matches(@".value = ""00e4a"" + ""92212"" + ""90799"" + ""497"";", @"""(.+?)""");
        foreach (Match m in mc)
        {
            //m.Value;//就是结果
            Console.WriteLine(m.Groups[1].Value);
        }
        //一句话的方式合成一个字符串
        string result = string.Join("", mc.Cast<Match>().Select(m => m.Groups[1].Value).ToArray());
        //输出:00e4a9221290799497
        Console.WriteLine(result);
    }