# JsonPath exception "string matching regex \`\[$\_\\p{L}\]\[$\_\\-\\d\\p{L}\]\*'"

**URL:** <https://community.gatling.io/t/jsonpath-exception-string-matching-regex-p-l-d-p-l/930>\
**Category:** Gatling (Open-Source)\
**Created:** [April 7, 2014, 2:02pm UTC](https://community.gatling.io/t/jsonpath-exception-string-matching-regex-p-l-d-p-l/930 "2014-04-07T14:02:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikolaos.tsapanidis](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@nikolaos.tsapanidis](https://community.gatling.io/u/nikolaos.tsapanidis)\
**Post date:** [April 7, 2014, 2:02pm UTC](https://community.gatling.io/t/jsonpath-exception-string-matching-regex-p-l-d-p-l/930/1 "2014-04-07T14:02:49Z")

</div>

Hi,

I’ve a problem with jsonPath and a specific json response.

Here’s my JSON-Response: {“data”:[[22091],[22094],[22090],[22092],[22093]],“timestamp”:1396877533190}

It fails if I try to save it via → .check(jsonPath("$.data[\*][0]").saveAs(“all\_contacts”)))

15:48:33.943 [INFO] i.g.h.a.AsyncHandlerActor - Request ‘GetAllContacts’ failed: jsonPath($.data[_].[_]).exists failed, could not extract: could not extract : string matching regex `[$_\p{L}][$_\-\d\p{L}]*' expected but `[’ found

Any idea what’s going wrong?!

Greetings  
Niko

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [April 7, 2014, 2:03pm UTC](https://community.gatling.io/t/jsonpath-exception-string-matching-regex-p-l-d-p-l/930/2 "2014-04-07T14:03:48Z")

</div>

Gatling version, please?

---

<div class="post-metadata">

**Author:** ![nikolaos.tsapanidis](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@nikolaos.tsapanidis](https://community.gatling.io/u/nikolaos.tsapanidis)\
**Post date:** [April 7, 2014, 2:09pm UTC](https://community.gatling.io/t/jsonpath-exception-string-matching-regex-p-l-d-p-l/930/3 "2014-04-07T14:09:25Z")

</div>

latest 2.0.0-SNAPSHOT build.

---

<div class="post-metadata">

**Author:** ![Nicolas\_R](https://avatars.discourse-cdn.com/v4/letter/n/f14d63/32.png) [@Nicolas\_R](https://community.gatling.io/u/Nicolas_R)\
**Post date:** [April 7, 2014, 2:30pm UTC](https://community.gatling.io/t/jsonpath-exception-string-matching-regex-p-l-d-p-l/930/4 "2014-04-07T14:30:10Z")

</div>

Hi Nikolaos,

I just tried your example, it works perfectly. This unit test passes.

it should “Mailing-list test case” in {  
val json = parseJson(""" {“data”:[[22091],[22094],[22090],[22092],[22093]],“timestamp”:1396877533190} “”")  
JsonPath.query("$.data[\*][0]", json) should findOrderedElements(int(22091), int(22094), int(22090), int(22092), int(22093))  
}

Now, notice that your example is NOT the same as what there is in the log exception.  
Here is the correct version for it :

jsonPath($.data[_].[_]) → jsonPath($.data[_][_])

regards  
Nicolas

---

<div class="post-metadata">

**Author:** ![nikolaos.tsapanidis](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@nikolaos.tsapanidis](https://community.gatling.io/u/nikolaos.tsapanidis)\
**Post date:** [April 7, 2014, 8:00pm UTC](https://community.gatling.io/t/jsonpath-exception-string-matching-regex-p-l-d-p-l/930/5 "2014-04-07T20:00:14Z")

</div>

Hi Nicolas,

yep works fine. Thx for the hint

Greetings  
Niko
