How to extract the userkey value when %2F is present in an expression in jmeter

42 Views Asked by At

I am creating a script in JMeter for performance testing!
I need to get the userkey form the response header.
As we can see below is the short response for the same:
&Userkey=AMfN%2Fm1wlh

And I tried using the below regex:
Userkey=(.+?)\n
Userkey=(.+?)%2F(.+?)\n
But didn't got solution using post processor, i.e. regular expression extractor in JMeter

1

There are 1 best solutions below

1
Dmitri T On BEST ANSWER

Try the following regular expression:

Userkey=(.*)

Where:

  • . - matches any character
  • * - repetition
  • () - grouping

As you can see it produces a match in "RegExp Tester" mode of the View Results Tree listener:

enter image description here

More information: