KTL
KTL

Reputation: 11

How to correlate value for new line value

I am trying to correlate below values but not able to do it.

I have searched below regex in regex tester but it is not working.

Value:1:

this.setRequestHeader("tempSpecId", "737896904057736821");

tried regex:this.setRequestHeader(\s+"tempSpecId",\s+"([^"]+)"\s*)

value:2:

var tririgaSecurity = new TririgaSecurity("NDBkZTEyYzQxMDVl","HzrbV1mi-KKloFirhlE91LHiTV-s4M_A");

Here both the values are changing and not able to find it in regex tester with below:

"tririgasecuritytokeninput", "([a-zA-Z0-9]+)

Please let me know how to handle these values.

you're help will be appreciated.

Upvotes: 0

Views: 535

Answers (1)

manish
manish

Reputation: 96

When you are using regular expressions with round braces, they become a pattern group. A simpler solution would be to use this regex for value 1

(\s*"tempSpecId",\s*")(\d*) 

and the template would be $2$ along with the match No set to 1

enter image description here

For value 2, use the following regular expression

TririgaSecurity[(]"([\w]*)","(.*)"

for the first value which is 'NDBkZTEyYzQxMDVl', can be obtained from the 1st pattern group i.e by using the template $1$ and the match No set to 1

enter image description here

the second value which is 'HzrbV1mi-KKloFirhlE91LHiTV-s4M_A' can be obtained from the second pattern group of the regex result i.e. the template $2$ and the match No set to 1

enter image description here

Here is the response in the Debug Postprocessor, for the same regular expressions and the pattern groups

enter image description here

Upvotes: 0

Related Questions