+ Start a Discussion
Anil SavaliyaAnil Savaliya 

get value from JSON string

String JS = '[{EntityID:3140001, User: "ABC@test.com"},{EntityID:4902138, User: "ABC@test.com"},{EntityID:43962599, User: "ABC@test.com"},{EntityID:46326732, User: "ABC@test.com"},{EntityID:50678752, User: "ABC@test.com"},{EntityID:3471919, User: "ABC@test.com"},{EntityID:3529201, User: "ABC@test.com"},{EntityID:3145503, User: "ABC@test.com"},{EntityID:478345, User: "ABC@test.com"},{EntityID:3599697, User: "ABC@test.com"},{EntityID:459246, User: "ABC@test.com"},{EntityID:49732437, User: "ABC@test.com"},{EntityID:3858674, User: "ABC@test.com"},{EntityID:459246, User: "ABC@test.com"},{EntityID:478345, User: "ABC@test.com"},{EntityID:3227994, User: "ABC@test.com"},{EntityID:3227994, User: "ABC@test.com"},{EntityID:124412, User: "ABC@test.com"},{EntityID:3140001, User: "xyz@test.com"},{EntityID:4902138, User: "xyz@test.com"},{EntityID:43962599, User: "xyz@test.com"},{EntityID:46326732, User: "xyz@test.com"},{EntityID:50678752, User: "xyz@test.com"},{EntityID:3471919, User: "xyz@test.com"},{EntityID:3529201, User: "xyz@test.com"},{EntityID:3145503, User: "xyz@test.com"},{EntityID:478345, User: "xyz@test.com"},{EntityID:3599697, User: "xyz@test.com"},{EntityID:459246, User: "xyz@test.com"},{EntityID:49732437, User: "xyz@test.com"},{EntityID:3858674, User: "xyz@test.com"},{EntityID:459246, User: "xyz@test.com"},{EntityID:478345, User: "xyz@test.com"},{EntityID:3227994, User: "xyz@test.com"},{EntityID:3227994, User: "xyz@test.com"},{EntityID:124412, User: "xyz@test.com"}][{EntityID:3140001, User: "ABC@test.com"},{EntityID:4902138, User: "ABC@test.com"},{EntityID:43962599, User: "ABC@test.com"},{EntityID:46326732, User: "ABC@test.com"},{EntityID:50678752, User: "ABC@test.com"},{EntityID:3471919, User: "ABC@test.com"},{EntityID:3529201, User: "ABC@test.com"},{EntityID:3145503, User: "ABC@test.com"},{EntityID:478345, User: "ABC@test.com"},{EntityID:3599697, User: "ABC@test.com"},{EntityID:459246, User: "ABC@test.com"},{EntityID:49732437, User: "ABC@test.com"},{EntityID:3858674, User: "ABC@test.com"},{EntityID:459246, User: "ABC@test.com"},{EntityID:478345, User: "ABC@test.com"},{EntityID:3227994, User: "ABC@test.com"},{EntityID:3227994, User: "ABC@test.com"},{EntityID:124412, User: "ABC@test.com"},{EntityID:3140001, User: "xyz@test.com"},{EntityID:4902138, User: "xyz@test.com"},{EntityID:43962599, User: "xyz@test.com"},{EntityID:46326732, User: "xyz@test.com"},{EntityID:50678752, User: "xyz@test.com"},{EntityID:3471919, User: "xyz@test.com"},{EntityID:3529201, User: "xyz@test.com"},{EntityID:3145503, User: "xyz@test.com"},{EntityID:478345, User: "xyz@test.com"},{EntityID:3599697, User: "xyz@test.com"},{EntityID:459246, User: "xyz@test.com"},{EntityID:49732437, User: "xyz@test.com"},{EntityID:3858674, User: "xyz@test.com"},{EntityID:459246, User: "xyz@test.com"},{EntityID:478345, User: "xyz@test.com"},{EntityID:3227994, User: "xyz@test.com"},{EntityID:3227994, User: "xyz@test.com"},{EntityID:124412, User: "xyz@test.com"}]';


I need get value between each {.......},How can i get ? I try use

string subject = JS;
Pattern p = Pattern.compile('\\{(.+?)\\}');

Matcher m = p.matcher(subject);
,But it's not work

How could get value like

Index 1 = EntityID:3140001, User: "ABC@test.com"
Index 2 = EntityID:4902138, User: "ABC@test.com"
----------------------------------------------------------
--------------------------------------------------------
Index  40 (Last any number) = EntityID:124412, User: xyz@test.com (mailto:xyz@test.com)

Ramu_SFDCRamu_SFDC
Please review the JSONParser class methods at the link http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_json_jsonparser.htm