Description
Returns the original input string with the text matching the specific pattern replaced with the replacement string.
Syntax
REGEXREPLACE ( input, regex, replacement )
Parameter | Description |
---|---|
input | Source string to be matched against the pattern (i.e., regular expression). |
regex | The regular expression. |
replacement | String to replace matched strings within the source input. |
Remarks
For an overview of Regular Expressions, refer to About Regular Expressions.
There are several sites that allow you to refine or test your regular expression before adding it to this function in your DTS file. For help with creating regular expressions, TIBCO suggests that you do an internet search on the phrase Regex Builder to find useful resources.
Examples
The following example searches source field S17 for a simple pattern (or expression) "XM". When it is found, the function replaces it with the string "XL".
REGEXREPLACE(S17, "XM", "XL")
For source input containing "XM2000, XMe2000XP, XM2000-MOD", the function returns "XL2000, XLe2000XP, XL2000-MOD".
See also