正则表达式分割数组

用正则表达式分割数组很方便:
例如:
一个字符串
"天马山","天马山","0XFF07","310117000","地址",121.141618,31.064277
的分割:
            string str = "\"天马山\",\"天马山\",\"0XFF07\",\"310117000\",\"地址\",121.141618,31.064277";
            
string[] splitstr;
            str 
= str.TrimStart(new char[] '"' });
            splitstr 
= Regex.Split(str, "\",\"(.*?)\",\"(.*?)\",\"(.*?)\",\"(.*?)\",(.*?),", RegexOptions.Compiled | RegexOptions.Singleline);


posted @ 2008-09-26 11:51  半克拉鹅卵石  阅读(602)  评论(0编辑  收藏  举报