hello everyone, i would like to find a Regex pattern within a string, and replace the entire string value with only a portion of that matched pattern
i know i can do this with the following:
REGEX_Replace([Dest], '.*TZ::([/\w]+?),.*', '$1')
But it only works if the pattern exists.. If the pattern isn't found, then the returned value is the entire string (i would prefer it to return null).. a complete solution requires me to first check for the pattern, and THEN replace it
if
REGEX_Match([Dest], '.*TZ::([/\w]+?),.*') = -1
then
REGEX_Replace([Dest], '.*TZ::([/\w]+?),.*', '$1')
else
null()
endif
Is there any way to accomplish this with a single statement without the "If" condition?