This kind of works like the popular LoadRunenr web_reg_save_param function, hence I named it as web_reg_param_custom()

void web_reg_save_param_custom(char *sourceStr, char* outpuStr, char *leftBdry, char *rightBdry)

{
	char *st1, *st2;
	int result, i = 0;

             i=strlen(leftBdry);
	st1 = (char*) strstr(sourceStr, leftBdry);

	if (st1 != NULL){
		st1 += i;
		st2 = (char*) strstr(st1, rightBdry);

		if (st2 != NULL){
			result = st2 - st1;
			*(st1 + result) = '\0';
		}
	}

	if ((st1 == NULL) || (st2 == NULL))
		lr_error_message("Error: No substring found for the specified boundary");
             else
    	             lr_save_string(lr_eval_string(st1), outpuStr);

}

Usage example:

web_reg_save_param_custom(lr_eval_string("{originalString}"),"outputString","token", "endKey" );

The function call shown above fetches a substring from the “originalString” parameter and saves it in “outputString” paramater based on the Left and Right boundary values – “Token” and “endKey”. So if “originalString” param had the value “xyzToken3234344endKey,” the outputString parameter will contain the value “3234344″