3

I have a json data:

{
  "id": 101,
  "type": "test",
  "data": {
    "value1": "dog",
    "name1": "A",
    "value2": "pig",
    "name2": "B",
    "value3": "cat",
    "name3": "C"
  }
}

I want to apply JSONPath to it to only return results with key have prefix = value* in data.

The expected result is :

[
  {
    "dog",
    "pig",
    "cat",
  }
]

Which way to filter json key by regex in JSONPath expression?

1 Answer 1

1

Is you json dta is fix, if yes then you can go for below without using regex

$.data.[value1,value2,value3]

Sign up to request clarification or add additional context in comments.

1 Comment

Thank @amy, but the value is not fix, it can be $.data.[value1,value2,value3,value4 ...]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.