ibis.expr.api.StringValue.re_replace

StringValue.re_replace(arg, pattern, replacement)

Replaces match found by regex with replacement string. Replacement string can also be a regex

Parameters
patternstring (regular expression string)
replacementstring (can be regular expression string)
Returns
modifiedstring

Examples

>>> import ibis
>>> table = ibis.table([('strings', 'string')])
>>> result = table.strings.replace('(b+)', r'<>')  # 'aaabbbaa' becomes 'aaa<bbb>aaa'  # noqa: E501