sub
relationalai.semantics.std.re
sub(regex: StringValue, repl: StringValue, value: StringValue) -> StringValueReplace occurrences of the regex in the value with the replacement string.
Parameters
Section titled “Parameters”
(regexStringValue) - The regular expression pattern.
(replStringValue) - The replacement string.
(valueStringValue) - The string value to perform substitution on.
Returns
Section titled “Returns”Expression- AnExpressioncomputing the substituted string. ReturnsString.
Examples
Section titled “Examples”Replace occurrences of a pattern in a string:
define(Text.new(content="The party starts at 8:00 PM or at 9:00 PM."))re.sub(r"\d{1,2}:\d{2} [AP]M", "<??>", Text.content)select(Text.content, re.sub(r"\d{1,2}:\d{2} [AP]M", "<??>", Text.content))