0

I want to create a regular expression to extract A-ticket from Json ( A value which exists after the A-ticket.I need the value without "". Then I need to pass the key into respective requests in Jmeter.

{"test","test2","A-ticket":"4523963f-6c9a-4d6a-b862-f35db64fc536","amr":["password"]}

I would expect 4523963f-6c9a-4d6a-b862-f35db64fc536 (I don't need A-ticket and "". Only need the value)

This is the regular expression which I created.But this is not working in Jmeter because it doesn't support look behind.

(?<=A-ticket”:“).[^”]*

Flashmark
  • 119
  • 2
  • 10
  • You do not need a lookbehind. Use `"A-ticket":"([^"]+)` with `$1$` template. A better idea is to use JSON Extractor. – Wiktor Stribiżew Mar 07 '19 at 08:53
  • 1
    I don't know what programming language you are using, but most of this times in cases like this string, you can put it inside a function where is returns an `Object` or `Array` version of you string. So than you would just say: `object->amr` and it would return `["password"]`. You should look this up corresponding to your programming language. – Derk Jan Speelman Mar 07 '19 at 08:55
  • Also, [this might help](https://stackoverflow.com/questions/45147275/extracting-value-in-between-quotes-regular-expressions), too. – Wiktor Stribiżew Mar 07 '19 at 08:57

0 Answers0