I have bellow response header that is giving me the problem when extracted using Regular Expression Extractor. To keep to story short, after troubleshooting I come up with a solution that works but is not perfect.
The Headers
Response headers:
HTTP/1.1 200 OK
Vary: Origin, Accept-Encoding
Access-Control-Allow-Credentials: true
X-XSS-Protection: 1; mode=block
X-Frame-Options: DENY
X-Download-Options: noopen
X-Content-Type-Options: nosniff
access-token: GAbnLmcDzT4j5INPkSGwdbQzZIIFIaJoy4wBnmNUF4NEgGB11IfzTAMdqXyxIhAZ
Access-Control-Expose-Headers: access-token
Content-Type: application/json; charset=utf-8
The Solution
Regular Expression : access-token: (.+?)\n
Template : $1$
Refer to below picture on why I think the solution is wrong.
Extracted token is represented by multiple variable as result_token, result_token_g, result_token_g0, result_token_g1
:
The Question
What is the correct Regular expression and template to get only the token.
TIA!
UPDATE:
Bellow excerpt from Regular Expression Extractor Doc actually help me better understand this question.
If the match number is set to a negative number, then all the possible matches in the sampler data are processed. The variables are set as follows:
refName_matchNr - the number of matches found; could be 0
refName_n, where n = 1,2,3 etc - the strings as generated by the template
refName_n_gm, where m=0,1,2 - the groups for match n
refName - always set to the actual template value if a match is found, otherwise, the default value.