1

I want to extract a string from the URL. I have the following URL :

https://optim.actiontec.com/aei-api/users/R1RCQTY1MjA1MDYyMDc%3D

I want to extract the string after users/ and store it in a variable that I can use. I tried using the regular expression extractor but it did not work.

My second issue is extracting stuff from request headers. I dont know much about it but can we extract stuff from Request headers? This is my request header -

GET /aei-api/main/R1RCQTY1MjA1MDYyMDc%3D HTTP/1.1
Host: optim.actiontec.com
Connection: keep-alive
Accept: application/json, text/plain, */*
X-Token: 03a580b082140ee7
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
X-User-Id: R1RCQTY1MjA1MDYyMDc=
Referer: https://optim.actiontec.com/
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9 

And I am looking to extract X-User-Id.I want to use the header value and pass it to other headers. Is it possible? Thanks

2
  • show your current code/regexp (even if broken) Commented Dec 1, 2017 at 0:14
  • This is what I am using : /users/(.+?). Doing so gives me just the first charachter i.e R Commented Dec 1, 2017 at 0:24

1 Answer 1

1

The Regex configuration would be like this:

Field to check: Request Header
Reference Name: var
Regular Expression: X-User-Id: (\w+.)
Template: $1$
Match No: 1

Screenshot showing regex test:

enter image description here

For Regex test see here: https://regex101.com/r/MMhn3i/1/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.