how to save a token with regex

My response is:

`

body=
{“access_token”:“e…g”,“expires_in”:2592000,“token_type”:“Bearer”}

`

I want to save the token in a variable for further requests. That is the value from ‘e’ to (and included ‘g’) in the access_token above.

I want to use reggae like this:

`

.check(regex("""whatDoIPutHere""").exists.saveAs("token)"))

`

Any tips?

Cheers!

Ahh, my bad, this is a json response and then it works with:

`

.check(jsonPath("$.access_token").exists.saveAs("token"))

`