base » saveReplace(text,regex,replace,resultVar)
Description
This command does a number of things:
- Nexial reads in
text
- Nexial matches it against the specified
regex
, and replace all matched portion/region oftext
with the specified text (replace
) - Nexial saves the modified text into a new variable denoted as
resultVar
If text
is specified via the ${...}
syntax, Nexial internally will handle the appropriate conversion if the
target variable represents an array, a list, a map or a Java object.
Parameters
- text - the text (can be referenced via ${…} syntax) that will be evaluated.
- regex - the regular expression to use for this match and replace operation
- replace - the text to replace all the matched region/portion of
text
- resultVar - the name of the new variable to save the replaced text
Example
Here’s an example of this command:
The output shows the modified text under var10
: