Share this page

# lr_save_param_regexp

Finds a match or matches to a regular expression in a buffer, and saves the capture group to a parameter.

## C Language

    int lr_save_param_regexp (char* bufferToSearch, int bufferSize, char * RegExp[/IC], int Ordinal, char * ResultParam, LAST);

Example of Parameter Array Use | Parameter Functions

## Arguments

Name | Comments
--- | ---
bufferToSearch | The buffer in which to search for matches. The buffer can contain binary data.
bufferSize | In bytes.
RegExp[/IC] | A regular expression with exactly one capture group. This argument must appear in the format name=value. For example: `RegExp=(r*)` If `IC` is appended to the name of the argument, the search is not case sensitive. For example: `"RegExp/IC=(r*)"` matches 'RR' and 'rRr'.
Ordinal | (Optional) The 1-based location of the match to find. This argument must appear in the format name=value. For example: `Ordinal=2` finds the second match. A value of 0 indicates to find all matches and save the capture strings in a parameter array. The symbol `All` can be used in place of 0. For example, `"Ordinal=All"`. If this argument is not specified, the default value 1 is used.
ResultParam | The name of the parameter or parameter array to save the matches in. This argument must appear in the format name=value. For example: `ResultParam=reMatchesParam`.
LAST | A marker that indicates the end of the argument list.

lr_save_param_regexp searches inside a buffer for a match or matches to a regular expression.

If Ordinal is an integer greater than 0 and at least that number of matches is found, a parameter is created with the name specified by the `ResultParam` argument. The value of the parameter is the capture group of the match.

If Ordinal is ALL (0) and at least one match is found, a parameter array is created. The values of the parameters are the capture groups of the matches.

The parameter is not created if either no matches are found or if an Ordinal value is specified and fewer matches are found. For example, if `"Ordinal=3"` and only 2 matches are found, the parameter is not created.

If there are multiple calls with the same result parameter, each call overwrites the previous value.

The last result parameter value from a call to lr_save_param_regexp in an iteration persists between iterations. The first call in an iteration overwrites the previous value.

## Return Values

This function returns LR_PASS (0) on success, and LR_FAIL (1) on failure. Note that in many cases, this return value indicates the technical success of the function, and not the result. For example, a function that registers a string to be found in a subsequent step returns LR_PASS to indicate that the registration was successful. This does not indicate that the string was found in the server response.

## Parameterization

Standard parameterization is not available for this function.

See Also

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: