arr[1][3]=['100','xxx','5','img/1.gif'];
arr[1][2]=['100','xxx','3','img/12.gif'];取  1    100   xxx;每列数组对应的取出一行类似数据  

解决方案 »

  1.   

    arr[1][3]=['100','xxx','5','img/1.gif'];
    arr[1][2]=['100','xxx','3','img/12.gif'];arr\[(?<str>[^\]])]\[\d*\]=\['(?<val1>[^']*)','(?<val2>[^']*)'
    测试没问题
      

  2.   


    (?i)arr\[([^]]+)\][^']+'([^']+)','([^']+)'[^]]+\];分别取Group[1]  Group[2]  Group[3] 的值 
      

  3.   


            /// <summary>
            /// 根据正则表达式获取匹配的分组
            /// </summary>
            /// <param name="html">HTML字符串</param>
            /// <param name="regex">正则表达式</param>
            /// <returns></returns>
            public static MatchCollection GetGroupByRegex(string html, string regex)
            {
                if (string.IsNullOrEmpty(html) || string.IsNullOrEmpty(regex)) return null;            Regex r = new Regex(regex, RegexOptions.IgnoreCase);
                return r.Matches(html);
            }
    ///如果是文件,读取文件并赋值给html
    string html ="数据源";
    MatchCollection coll;
    string privateFundsCodeRegex = "arr\\[(?<str>[^\\]])]\\[\\d*\\]=\\['(?<val1>[^']*)','(?<val2>[^']*)'"; coll =GetGroupByRegex(html, privateFundsCodeRegex);                for (int i = 0; i < coll.Count; i++)
                    {
                        string str = coll[i].Groups["str"].Value.Trim();
                        string val1 = coll[i].Groups["val1"].Value.Trim();
                        string val2 = coll[i].Groups["val2"].Value.Trim();
    ///做你想做的                }