For correllating my current HTTP script for an SAP Web application I ran into a ton of trouble with the traditional LB/RB approach of web_reg_save_param_ex, and decided to dive in to regexp as a whole. After beating my head against a wall for a bit, I noticed in the documentation's examples the authors are actually double-escaping anything that is a literal or is an escape char that needs to stay there.
Here's an exampl e. I had retreive the mangled string in the center of the below url from the server's response body.
?application_list[1].exit_url=/sap(bD1lbiZjPTQwMCZkPW1bg==)/bc/bsp/sap/crm_ic/default.htm
web_reg_save_param_regexp("ParamName=corSapShortUrl","RegExp=application_list\\[1]\\.exit_url=/sap\\((.*)\\)/bc/bsp/sap/crm_ic","Ordinal=1", SEARCH_FILTERS,"Scope=Body","IgnoreRedirections=No", LAST);
In order for the escaped literals to remain escaped according to compiler, you have to escape the escape marks. It can get a bit silly in some cases. Here is another example below.
/* 8_V27_admini_table[1].unit\\" class=\\"sapDdlWhl\\"><option value=\\"CON\\" selected>?alsotry~ "RegExp=table\\[[0-9]+?\\]\\.unit\\\\\" .+?\\<option value=\\\\\"([A-Za-z]+?)\\\\\" selected\\>", */
web_reg_save_param_regexp(
"ParamName=Material1Unit",
"RegExp=admini_table\\[1\\]\\.unit\\\\\" .+?><option value=\\\\\"([A-Za-z]+?)\\\\\" selected>",
SEARCH_FILTERS,
"Scope=Body",
"IgnoreRedirections=No",
LAST);
I admit that these regular expression strings look like they could be overkill for what I'm trying to capture. They work though!
Hope this helps!