PhixFlow Help

replaceAll



Function: replaceAll()

Replace all occurrences of a pattern with a replacement string.

Syntax

replaceAll(listToCheck, findPattern, replacementString)

ArgumentTypeDescription
listToCheckString or Array A string (or list of strings) to evaluate.
findPatternRegular ExpressionPattern to be matched in listToCheck
replacementStringStringString to replace matching pattern in list

Examples

replaceAll(in.fileName, "[0-9]{8}", "")

replaceAll() removes all strings of 8 digits from file names contained in the attribute in.fileName.

If in.fileName = "20060712file-proc20070103-1263", this returns "file-proc-1263".


replaceAll(in.BudgetCode,"\\\\","")

This expression removes any backslashes ("\") in the string "in.BudgetCode" e.g. if in.BudgetCode is "323\-ABC", the value returned is "323-ABC". The reason that multiple backslashes are used is because "\" is an "escape" character in a Regular Expression. This allows special control charaters to be treated as regular characters. See Regular Expression for more details. 

See Also

Please let us know if we could improve this page feedback@phixflow.com