Highlighted
vijaydi
Visitor.
1257 views

Help representing Regex in Loadrunner

Hi, 

the below regular expression gives the required match when tried on teh regex tools online (see attached snapshot regex.PNG) 

input type="hidden" name=".*?3b0a0a4a1a1a\db3-h

When I try the same using the regex funtion in LR it doesnt find a match. I see the expression is represented slightly different in the LR function and have used the below. 

Please note I the place I have used *? and \d, the values are dynamic  (plesae note the Page Response below)

 web_reg_save_param_regexp(
        "ParamName=Correlation3",
        "RegExp=input type=\"hidden\" name=.*?3b0a0a4a1a1a(\\d)b3-h"
        "Ordinal=All",
         SEARCH_FILTERS,
        "Scope=Body",
        LAST );

 

Page Response :

<input type="hidden" name="_2a0bi3b0a0a4a1a1a1b3-h

<input type="hidden" name="_2a0bi3b0a0a4a1a1a2b3-h

<input type="hidden" name="_2a0bi3b0a0a4a1a1a3b3-h

Request you to please assist. 

Thanks.

 

 

Tags (1)
0 Likes
2 Replies
Micro Focus Expert
Micro Focus Expert

Re: Help representing Regex in Loadrunner

Hi,

This works :

web_reg_save_param_regexp(
        "ParamName=Correlation3",
        "RegExp=input type=\"hidden\" name=\".*?3b0a0a4a1a1a(\\d)b3-h\"",
        "Ordinal=All",
         SEARCH_FILTERS,
        "Scope=Body",
        LAST );

Note that you missed  comma "," character after your RegExp string.

Best regards

0 Likes
Moshka Honored Contributor.
Honored Contributor.

Re: Help representing Regex in Loadrunner

one more comment.

 

when using online regular expression tools, please verify you are testing with PCRE flavor

Micro Focus Performance Core.
Functional Architect
your performance, our passion!
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.