Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Description

Resolves to the line(s) of variable data that match the specified regular expression, of the specified variable.

  • If the variable is unresolved, the function will remain unresolved.

  • If the variable is undefined, blank, or no lines qualify, the function will resolve to the default value.

Syntax

${_varLinesByRegex('variableName', 'regexPattern'[, maxCount, numberOfLinesBefore, numberOfLinesAfter, 'defaultValue', 'resultDelimiter'])}

Parameters

variableName
Required; The name of the variable to apply the function to.

regexPattern
Required; Regular expression used for determining if a line matches. Regular expression must match the whole line (see Example, below).

maxCount
Optional; Maximum number of matching lines to return. Default is 1.

numberOfLinesBefore
Optional; Number of lines before each matching line to return along with the matching line. Default is 0.

numberOfLinesAfter
Optional; Number of lines after each matching line to return along with the matching line. Default is 0.

defaultValue
Optional; Default value to return if the result is not found. Default is empty ('').

resultDelimiter
Optional; Delimiter to use when concatenating matching lines. If not specified, "\n" or "\r\n" depending on original output line endings.

Example

my_variable=
Some_Text
ABC=Some_String
More_Text

${_varLinesByRegex('my_variable', '^ABC=')} /* Returns empty (the whole Line was not matched) */
>

${_varLinesByRegex('my_variable', '^ABC=.*')}
> ABC=Some_String

Variable Path

Description

Returns a token representing the path to a temporary file containing the value of the specified variable.

  • $(ops_variable_path_<variableName><fileExtension>)

The resolved token is supported within the Command, Parameters, and Script of a Windows and Linux/Unix Task.

Syntax

${_varPath('variableName'[, 'fileExtension'])}

Parameters

variableName
Required; The variable to create a temporary file for.

fileExtension
Optional; The extension to use for the temporary file. Can be a maximum of 10 characters. Default is txt.

Example

application.exe -file ${_varPath('my_variable')}
> application.exe -file $(ops_variable_path_my_variable_txt)

application.exe -file ${_varPath('my_variable', 'csv')}
> application.exe -file $(ops_variable_path_my_variable_csv)

Anchor
System Functions
System Functions
System Functions

...