How to use Modify actions with regular expressions in PI Output Enhancement

print
Product Feature: General


 

[MODIFY_NAME] MODIFY [VARIABLE_NAME] SEARCH "search" REGEX/NOREGEX REPLACE "replace" REPLACEALL IGNORECASE;
 
Syntax breakdown:
[MODIFY_NAME]

The function name. MODIFY is constant and name can be any alphanumeric value the user requires. We recommend you use the naming conventions previously described. The square brackets are mandatory.

MODIFY
Mandatory. The P/I Output Enhancement command being used.
 
[VARIABLE_NAME]
Mandatory. The name of the variable containing the string to be modified.

SEARCH
Mandatory. The regular expression for the action being undertaken.
 
"search"
The value for SEARCH. This can be an alphanumeric value, a parameter that evaluates to an alphanumeric value or a variable containing an alphanumeric value.
 
REPLACE
Mandatory. The regular expression being carried out.
 
REGEX or NOREGEX
Optional. Specifies that the search pattern specified in this particular ACTION is treated as a literal string irrespective of whether VDEOPTIONS REGULAREXPRESSIONS is specified or not in PARENT command.
REGEX Requests that regular expressions for this ACTION are evaluated when the parent syntax is NOT present.
 NOREGEX Requests that regular expressions for this ACTION are evaluated when the parent syntax is present.

"replace"
The value for REPLACE. This can be an alphanumeric value, a parameter that evaluates to an alphanumeric value or a variable containing an alphanumeric value.
 
REPLACEALL
Optional. All data in the search string is replaced by that specified in the replace string.
 
IGNORECASE
Optional. Lower and uppercase characters are considered valid in the search string. The default is that search strings are case sensitive.
 
;
Mandatory. Terminates the command.

Example:
When the parent syntax is present then the keyword NOREGEX is to be used to ensure that the text is treated literally
MODIFY [VAR1] SEARCH NOREGEX “****” REPLACE “newstring”;

This can be done on per command level
[MODIFY_REMOVE_EXTENSION] MODIFY [VARIABLE_1] SEARCH REGEX "\.pdf" REPLACE ""; 

 

Question

Subject: PIOE 2.4.3 Modify Action is not working as expected

Initial Details: The MODIFY action is not working as expected. The PDF extension is not removed from the information assigned to a variable when the MODIFY action is called on the script. The MODIFY action works as expected on PIOM 1.1 [MODIFY_REMOVE_EXTENSION] MODIFY [VARIABLE_1] SEARCH "\.pdf" REPLACE "";

UPDATED: August 07, 2017

Contact Us