replace_re#

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

对于每个字符串,用提供的替换内容替换匹配给定模式的任何字符序列。

详情请参阅 cudf::strings::replace_re()

参数:
input

用于此操作的字符串实例。

patterns: RegexProgram 或 list[str]

如果是 RegexProgram,则为匹配每个字符串的正则表达式。如果是 list[str],则为在每个字符串中搜索的正则表达式字符串列表。

replacement标量 或 列

如果是标量,则为用于替换每个字符串中匹配序列的字符串。 patterns 必须是 RegexProgram。如果是列,则为用于替换的字符串。 patterns 必须是 list[str]。

max_replace_countint

在每个字符串中替换匹配模式的最大次数。 patterns 必须是 RegexProgram。默认为替换匹配到的所有子字符串。

flagsRegexFlags

用于解释模式中特殊字符的正则表达式标志。 patterns 必须是 list[str]

返回:
Column

新的字符串列

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

对于每个字符串,使用反向引用替换模板替换匹配给定正则表达式的任何字符序列。

详情请参阅 cudf::strings::replace_with_backrefs()

参数:
input

用于此操作的字符串实例。

prog: RegexProgram

正则表达式程序实例。

replacementstr

用于创建输出字符串的替换模板。

返回:
Column

新的字符串列。