jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: regex to mach a json
Date Wed, 08 Jun 2011 14:52:49 GMT
On 8 June 2011 14:58, zinedine <aspataru@avaya.com> wrote:
> Hello,
> I need to make a test that needs to get a JSON and then send it in a put
> request.
> I need to use the regex extractor to get the entire  JSON, but I don't know
> what regular expresion to use, because I need to extract only the response
> inside the  [] brackets.
> example:
> retrieved JSON : [{"name":"customer", "id":3, "phone":"555"}]
> what I have to send is only {"name":"customer", "id":3, "phone":"555"}.
> What regular expresion should I use?

For the example quoted, the following would work:

({"name":"customer", "id":3, "phone":"555"})

or

\[(^])+\]

It really depends on what varies and what the context is.

Use the Tree View Listener Regex tab to experiment on an actual response.

>
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/regex-to-mach-a-json-tp4469591p4469591.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Mime
View raw message