I have the following Response Body JSON:
{
\"address\": [
{
\"id\": \"1234\"
}
],
\"id\": \"d1a4f010-48d9-434b-9b3a-2d2b12f5e38c\
Using JMeter, you can use Regular Expression Extractor ...
Reference Name: myid
Regular Expression: "id": "(.+?)"
Template: $1$
Match No.: 2
If you specify using a Match No:...
0 = Random Match
1 = First Match
2 = Second Match
etc....
Or use corresponding variable to access the match. ${myid_2}
The variables are set as follows:
myid_matchNr - Number of matches found, possibly 0
myid_n - (n = 1, 2, etc..) Generated by the template
myid_n_gm - (m = 0, 1, 2) Groups for the match (n)
myid - By itself it is always set to the default value
myid_gn - Not set at all
Or judging by this case, if you prefer just regex and your strings are exactly as stated. You could do..
],\s+"id": "(.+?)"