0
votes

I'm confused. Why loadrunner throws a regular expression error?

web_reg_save_param_regexp(
    "ParamName=token",
    "RegExp=token=(.*?);",
    "Ordinal=All",
SEARCH_FILTERS,
    "Scope=Cookies",
LAST );

Catches the text here:

Set-Cookie: token=5c251325c6ba7a7294c1da9b%2FgxnEVacZjfiAHUY2eulpgpko4yMp93lG1ACKYKZcrK2tnDAIspXOsCQkzyPYH34S; Path=/; Expires=Mon, 16 Nov 2020 10:08:38 GMT; Secure
Set-Cookie: hasAccount=password; Path=/; Expires=Tue, 17 Dec 2019 10:08:38 GMT

output error:

Action.c(24): pcre_compile error: "this version of PCRE is compiled without UTF support" detected at pattern location:0     [MsgId: MMSG-26000]
2
Could you please send the script to LoadRunner feedback email in VuGen? I will look at it and post an answer here. - Buzzy

2 Answers

0
votes

I googled this problem, one hint was invalid regular expression. Try following solution.

First try to comment coockies and run the script as I usually do. Please avoid using (.*?). I have experience failure most of the time using it and I would suggest you to read this article on regular expression.

web_reg_save_param_regexp(
    "ParamName=token",
    "RegExp=token=[a-zA-Z0-9%]+;",
    "Ordinal=All",
SEARCH_FILTERS,
    "Scope=Cookies",
LAST );
0
votes

Try '+' instead of '*'. Also, it depends on the LR version. Below is the updated code

web_reg_save_param_regexp(
    "ParamName=token",
    "RegExp=token=(.+?);",
    "Ordinal=All",
SEARCH_FILTERS,
    "Scope=Cookies",
LAST );