I have data that looks like this

```
{
    "status": "success",
    "data": {
        "data1": {
            "serialNumber": "abc123",
            "version": "1.6"
        },
        "data2": {
            "irrelvent": [
                "irrelvent",
                "irrelvent"
            ]
        },
        "data3": {
            "irrelevantLibs": {
                "irrelevantFiles": [
                    "irrelevant.jar",
                    "irrelevant.jar",
                    "irrelevant.jar"
                ]
            }
        },
        "data4": {
            "configuration": "auth"
        }
    }
}

```

I am using the Jackson JSON Processor. What I need to do under the `data` object is to extract each `data(x)` into it's own data.

Hard to explain but I will try to be detailed. My intent is to make the JSON data more readable for our customers. So I'm trying to make the JSON data more friendly by splitting each `data(x)` object into blocks/tables on a website. So `data1` will be displayed independently. Then `data2` will be displayed independently and so on. So in this case I have four `data(x)` objects and I want to store those four objects into four different `Strings` and display them however I want. My problem is how do I get the Jackson Processor to do this?

Not sure if this is helpful but my current JSON function to process the JSON data is this:

```
public static String stringify(Object o) {
    try {
        ObjectMapper mapper = new ObjectMapper();
        DefaultPrettyPrinter printer = new DefaultPrettyPrinter();
        printer.indentArraysWith(new Lf2SpacesIndenter());
        return mapper.writer(printer).writeValueAsString(o);
    } catch (Exception e) {
        return null;
    }
}

```

I'm positive that I can manipulate the processor to get those data separated but I don't know where to start.

EDIT: Hmm, since Jackson seems to be a pretty difficult parser to work with, would it be easier if I used the Javascript JSON parser to extract only the `data` objects? Since I already have Jackson convert the JSON data into a String, using Javascript would work?
['https://Stackoverflow.com/questions/17536926', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1227566/']
Try:

```
def result = (articleContent =~ /<!\[CDATA\[(.+)]]>/)[ 0 ]​[ 1 ]

```

However I worry that you are planning to parse xml with regular expressions. If this cdata is part of a larger valid xml document, better to use an xml parser
In my case, the actual string was multi-line like below

```
ID : AB-223
Product : Standard Profile
Start Date : 2020-11-19 00:00:00
Subscription : Annual
Volume : 11
Page URL : null
Commitment : 1200.00
Start Date : 2020-11-25 00:00:00

```

I wanted to extract the `Start Date` value from this string so here is how my script looks like

```
def matches = (originalData =~ /(?<=Actual Start Date :).*/)
def extractedData = matches[0]

```

This regex extracts the string content from each line which has a prefix matching `Start Date :`

In my case, the result is is `2020-11-25 00:00:00`

**Note :** If your `originalData` is a multi-line string then in groovy you can include it as follows

```
def originalData = 
"""
ID : AB-223
Product : Standard Profile
Start Date : 2020-11-19 00:00:00
Subscription : Annual
Volume : 11
Page URL : null
Commitment : 1200.00
Start Date : 2020-11-25 00:00:00
"""

```

---

This script looks simple but took me some good time to figure out few things so I'm posting this here.