0

The original string looks like:

 [[{"v":new Date(2013, 2, 16, 8, 0),"f":"March 2013"},null,null,95,null,null,true],
 [{"v":new Date(2013, 3, 15, 20, 0),"f":"April 2013"},null,null,97,null,null,true]],
 "showHeadlines" ...  

You can see, there are a sequence of data which are included in a pair of "[ ]", and I want to extract the number which stay in "null, null, ..., null, null" combo. And my regular expression is:

  String reg = "null/,([0-9]*)/,null";

But it does not work. Could you help me to modify it? Thank you so much!!!!

beepretty
  • 1,075
  • 3
  • 14
  • 20

1 Answers1

-2

As HovercraftFullOfEels pointed out in the comments already, parsing JSON using RegEx is not recommended (reasoning here). Using a JSON Parser is the way to go.

Community
  • 1
  • 1
Seth
  • 1,545
  • 1
  • 16
  • 30