I have a snippet of html like this
<strong>
7834
</strong>
I need to extract the value 7834 -and use it in a form. The number is always different, so I can't just hardcode it. The spaces are generated by tabs on the line where the number is and new lines above and below the line where the number is
I've tried the below but both return FAIL (i.e not found in the body)
web_reg_save_param("magicnumber",
"LB=<strong>",
"RB=</strong>",
"Ord=1",
"SaveLen=4",
"NotFound=ERROR",
"Search=All",
LAST);
web_reg_save_param_regexp(
"ParamName=magicnumber",
"RegExp=<strong>(.*?)</strong>",
"Ordinal=1",
SEARCH_FILTERS,
"Scope=Body",
LAST);
OK, according to http://lrhelp.saas.hp.com/en/latest/help/function_reference/Content/web/etc/lrFr_web_regular_expessions.htm regex in loadrunner does not support character classes (like '\d' for digit or '\s' for space/tab), so I changed the expression to use character ranges [x-y] and negated ranges [^x-y].
Some regex flavours like to have the forward slash escaped by a backslash (perl, javascript).