Highlighted
Absent Member.. Absent Member..
Absent Member..
808 views

Regular Expression

Hi Friends,

Am trying to catch a value in the resposne of asynchronus call. I am able catch the value using LB and RB. ( "LB=\"Id\":","RB=\,", ) But i want use regular expresion for this case. can you please help me with the regular expression. 

 

Response String:  ...........................\\"TotalNumberOfRows\\":6}","Id":-1,"TypeInfo...................................................

To Catch: -1

Code: lr_save_param_regexp("aResponseBodyStr", strlen(aResponseBodyStr) , "RegExp=?", 0, "h_ID");

 

Thanks in Advance 🙂

 

Tags (1)
0 Likes
3 Replies
Highlighted
Super Contributor.
Super Contributor.

Re: Regular Expression

You can use web_reg_save_param_regexp() function to capture the string with appropriate regular expression, instead of web_reg_save_param().

 

Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Regular Expression

Hi Ajay, Yes , can you please help me with regexp? Thanks

0 Likes
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: Regular Expression

RegExp for Wizard:         TotalNumberOfRows\\"​:\d}","Id":(-\d),"TypeInfo
RegExp for web_reg_save(): TotalNumberOfRows\\\\\"​:\\d}\",\"Id\":(-\\d),\"TypeInfo

You may need to adjust this expression based on the expected range of the first and second numerical variable.

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.