Re: Interval operators {} in web_reg_save_param_regexp (5599 Views)
Reply
Frequent Advisor
Dan_J_Corey
Posts: 58
Registered: ‎04-16-2013
Message 1 of 7 (5,744 Views)
Accepted Solution

Interval operators {} in web_reg_save_param_regexp

I am attempting to correlate data coming back from the AUT server.  

 

My regexp is:

     web_reg_save_param_regexp("ParamName=Application""RegExp=Application-([\d-]{4,})\'"LAST);

 

My (very abbreviated) server response looks like:

'xyzvalue','69553','Application--1431562213-1599432006','', 'Container=Application')" >Correspondence</a></li>

 

According to this page vugen uses the PCRE regular expression engine

According to this PCRE regex checker the regex should match

 

However, I receive this error from vugen:

Error -35049: No match found for the requested parameter "Application". Check whether the requested regular expression exists in the response data  [MsgId: MERR-35049]

 

One thing to note is that vugen throws a warning saying:

Action.c(286): Warning: The string '4,' with parameter delimiters is not a parameter.

 

So... does vugen understand when to apply a regex interval operator and when to apply a parameter?  Or am I missing something here?  

HP Expert
MarkSmith
Posts: 17
Registered: ‎06-06-2010
Message 2 of 7 (5,656 Views)

Re: Interval operators {} in web_reg_save_param_regexp

Hi,

 

Looks like the "4," between the curly brackets is being treated as a parameter and not as part of the pattern - this needs to be clarifies. I found that this regexp seems to works on your data&colon;

 

"RegExp=Application-([-0123456789]+)\'",

 

Notify: Saving Parameter "Application = -1431562213-1599432006".

 

The following document may also be of interest:

 

http://support.openview.hp.com/selfsolve/document/KM00668973

 

Best regards,

 

Mark

Valued Contributor
Moshka
Posts: 42
Registered: ‎07-21-2011
Message 3 of 7 (5,643 Views)

Re: Interval operators {} in web_reg_save_param_regexp

Try to escape the { and } chars :
\\{ and \\}

LoadRunner DEV Eng.
LoadRunner - your performance, our passion!
Valued Contributor
Moshka
Posts: 42
Registered: ‎07-21-2011
Message 4 of 7 (5,642 Views)

Re: Interval operators {} in web_reg_save_param_regexp

web_reg_save_param_regexp("ParamName=Application", "RegExp=Application-([\d-]\\{4,\\})\'", LAST);
LoadRunner DEV Eng.
LoadRunner - your performance, our passion!
HP Expert
Editus
Posts: 650
Registered: ‎04-06-2011
Message 5 of 7 (5,637 Views)

Re: Interval operators {} in web_reg_save_param_regexp

Hello

on your function the curly brackets are recognized as parameters, but there is no parameter about that, so the best you can do is modify the charanter vugen uses for delimit the parameters, in general option you can change the { for something like /*// so only when it finds this 4 characters it will recognize this as a parameter, same for the closing bracket.

 

hope this helps

Valued Contributor
Moshka
Posts: 42
Registered: ‎07-21-2011
Message 6 of 7 (5,632 Views)

Re: Interval operators {} in web_reg_save_param_regexp

please see  the following KB about escaping brackets in Regular Expressions

http://support.openview.hp.com/selfsolve/document/KM00668973

 

LoadRunner DEV Eng.
LoadRunner - your performance, our passion!
Frequent Advisor
Dan_J_Corey
Posts: 58
Registered: ‎04-16-2013
Message 7 of 7 (5,599 Views)

Re: Interval operators {} in web_reg_save_param_regexp

Thanks everyone for your answers.  In the 3+ weeks since I posted this question I ended up having to custom code a solution on this and have since moved onto another project (I'm also not receiving email updates on posts for some reason).  However, Moshka since you're on the LR dev team and are citing a (new) KB I have marked your answer as the solution for future questions on this issue.  

 

If I encounter this question soon and the solution works, I'll confirm on this thread.  If a long time passes I will only repost on this thread if the solution does NOT work.  However, I figure you did your homework so I doubt I'll have a problem with the posted solution.  

 

Thanks!  

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.