-1

I have a simple string and I need to values of masterId and datasetId... masterId=27972&datasetId=4968&from

I tried below to get those values but I am getting invalid regular expression error

web_reg_save_param_regexp(
    "ParamName=Correlation1",
    "RegExp=masterId\=(.+?)&datasetId\=(.+?)&from",
    "Ordinal=All",
    SEARCH_FILTERS,
    LAST);

I have tried this regular expression in Jmeter and regex tester, it works. Can anyone help me to point what am I doing wrong in loadrunner?

2 Answers2

0

My guess is that you might not want to escape =, and this might simply work:

masterId=(.+?)&datasetId=(.+?)&from

Demo

Reference

LoadRunner Correlation with web_reg_save_param_regexp

Emma
  • 27,428
  • 11
  • 44
  • 69
  • I have tried that too. I know its a simple regular expression but in Vugen its not working at all. – user11672460 Jun 20 '19 at 14:24
  • Could you post the complete error description? Have you tried to point to the URL under Search filters? SEARCH_FILTERS, "RequestUrl=*/myurl/index.html", – twinge Jun 21 '19 at 10:20
  • Yes, I have tried that too but still giving the same error. Below is the detailed error - Action.c(47): Continuing after Error -35055: Invalid regular expression [MsgId: MERR-35055] Action.c(47): Registering web_reg_save_param_regexp highest severity level was "ERROR" [MsgId: MMSG-26389] – user11672460 Jun 21 '19 at 19:53
0

Replace (.+?) to (.*?).

No need to put \ in your RegExp but avoid using (.*?) in regular expression. Please use following instead:

web_reg_save_param_regexp(
    "ParamName=Correlation1",
    "RegExp=masterId=([0-9]+)&datasetId=([0-9]+)&from",
    "Ordinal=All",
    SEARCH_FILTERS,
    LAST);