# jsonpath and regex

**URL:** <https://community.gatling.io/t/jsonpath-and-regex/2938>\
**Category:** Gatling (Open-Source)\
**Created:** [April 19, 2016, 2:02pm UTC](https://community.gatling.io/t/jsonpath-and-regex/2938 "2016-04-19T14:02:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![morten\_bjoernsvik](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@morten\_bjoernsvik](https://community.gatling.io/u/morten_bjoernsvik)\
**Post date:** [April 19, 2016, 2:02pm UTC](https://community.gatling.io/t/jsonpath-and-regex/2938/1 "2016-04-19T14:02:26Z")

</div>

Hi all

I need to verify that some keys in the json response are not empty and save them

//This is how we do it today:  
.check(regex("""“number”:"(\S{8})"""").saveAs(“myPhoneNumber”))

//how can I get regex to apply to jsonPath output because we may have many different numbers  
//(poor design but outside my control)  
.check(jsonPath("$…customers[0].number").regexp(""""(\S+)"""").saveAs(“myPhoneNumber”))

Thanks

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [May 9, 2016, 3:58pm UTC](https://community.gatling.io/t/jsonpath-and-regex/2938/2 "2016-05-09T15:58:39Z")

</div>

Use a transform step in your check.
