Loadrunner,无效的正则表达式,为什么?

问题描述 投票:0回答:1

我很困惑。为什么loadrunner会引发正则表达式错误?

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

在此处捕获文本:

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

输出错误:

Action.c(24): pcre_compile error: "this version of PCRE is compiled without UTF support" detected at pattern location:0     [MsgId: MMSG-26000]
regex loadrunner
1个回答
0
投票

我搜索了这个问题,一个提示是无效的正则表达式。尝试以下解决方案。

[首先尝试注释社区并像往常一样运行脚本。请避免使用(.*?)。大多数情况下,使用它和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 );
© www.soinside.com 2019 - 2024. All rights reserved.