replace_re#

pylibcudf.strings.replace_re.replace_re(signatures, args, kwargs, defaults, _fused_sigindex={})#

For each string, replaces any character sequence matching the given patterns with the provided replacement.

For details, see cudf::strings::replace_re()

Parameters:
inputColumn

Strings instance for this operation.

patterns: RegexProgram or list[str]

If RegexProgram, the regex to match to each string. If list[str], a list of regex strings to search within each string.

replacementScalar or Column

If Scalar, the string used to replace the matched sequence in each string. patterns must be a RegexProgram. If Column, the strings used for replacement. patterns must be a list[str].

max_replace_countint

The maximum number of times to replace the matched pattern within each string. patterns must be a RegexProgram. Default replaces every substring that is matched.

flagsRegexFlags

Regex flags for interpreting special characters in the patterns. patterns must be a list[str]

Returns:
Column

New strings column

pylibcudf.strings.replace_re.replace_with_backrefs(Column input, RegexProgram prog, unicode replacement) Column#

For each string, replaces any character sequence matching the given regex using the replacement template for back-references.

For details, see cudf::strings::replace_with_backrefs()

Parameters:
inputColumn

Strings instance for this operation.

prog: RegexProgram

Regex program instance.

replacementstr

The replacement template for creating the output string.

Returns:
Column

New strings column.