有如下数组,要从中取出id:
"["3812662409","3812633637","3812627686","3812651467","3812628047","3812650203"]"
正则匹配可以直接用(d+),假定上述数组为变量名为input的字符串,C#中可以写作:
List<string> idList = new List<string>(); foreach(Match item in Regex.Matches(input, @"d+")) { idList.Add(item.Value); }