日期:2014-05-20 浏览次数:20851 次
@"\"BonusNumberString\":\"(?<v1>[^\"]+)\",\"BonusTime\":\"(?<v2>[^\"]+)\",\"IssueNumber\":\"(?<v3>[^\"]+)\""
------解决方案--------------------
void Main() { string str = @"var listIssue = [{""BonusNumberString"":""7,1,5,3,7|2|5"",""BonusTime"":""2011-10-13 00:40"",""IssueNumber"":""20111013-008""},{""BonusNumberString"":""7,7,4,4,6|2|5"",""BonusTime"":""2011-10-13 00:35"",""IssueNumber"":""20111013-007""},{""BonusNumberString"":""1,3,7,6,8|2|5"",""BonusTime"":""2011-10-13 00:30"",""IssueNumber"":""20111013-006""},{""BonusNumberString"":""2,3,9,3,6|2|5"",""BonusTime"":""2011-10-13 00:25"",""IssueNumber"":""20111013-005""},{""BonusNumberString"":""7,0,3,2,4|2|5"",""BonusTime"":""2011-10-13 00:20"",""IssueNumber"":""20111013-004""},{""BonusNumberString"":""2,9,6,7,2|2|5"",""BonusTime"":""2011-10-13 00:15"",""IssueNumber"":""20111013-003""},{""BonusNumberString"":""8,8,1,8,2|2|5"",""BonusTime"":""2011-10-13 00:10"",""IssueNumber"":""20111013-002""},{""BonusNumberString"":""1,9,7,6,3|2|5"",""BonusTime"":""2011-10-13 00:05"",""IssueNumber"":""20111013-001""},{""BonusNumberString"":""9,4,1,2,8|2|5"",""BonusTime"":""2011-10-13 00:00"",""IssueNumber"":""20111012-120""}];"; foreach(Match m in Regex.Matches(str,@"(?i)BonusNumberString"":""([^""]+)""\W+BonusTime"":""([^""]+)""\W+IssueNumber"":""([^""]+)")) { Console.WriteLine("BonusNumberString: {0}\tBonusTime: {1}\tIssueNumber: {2}",m.Groups[1].Value,m.Groups[2].Value,m.Groups[3].Value); } /* BonusNumberString: 7,1,5,3,7|2|5 BonusTime: 2011-10-13 00:40 IssueNumber: 20111013-008 BonusNumberString: 7,7,4,4,6|2|5 BonusTime: 2011-10-13 00:35 IssueNumber: 20111013-007 BonusNumberString: 1,3,7,6,8|2|5 BonusTime: 2011-10-13 00:30 IssueNumber: 20111013-006 BonusNumberString: 2,3,9,3,6|2|5 BonusTime: 2011-10-13 00:25 IssueNumber: 20111013-005 BonusNumberString: 7,0,3,2,4|2|5 BonusTime: 2011-10-13 00:20 IssueNumber: 20111013-004 BonusNumberString: 2,9,6,7,2|2|5 BonusTime: 2011-10-13 00:15 IssueNumber: 20111013-003 BonusNumberString: 8,8,1,8,2|2|5 BonusTime: 2011-10-13 00:10 IssueNumber: 20111013-002 BonusNumberString: 1,9,7,6,3|2|5 BonusTime: 2011-10-13 00:05 IssueNumber: 20111013-001 BonusNumberString: 9,4,1,2,8|2|5 BonusTime: 2011-10-13 00:00 IssueNumber: 20111012-120 */ }
------解决方案--------------------
http://blog.csdn.net/lxcnn/article/details/4756030