replace_re#
- pylibcudf.strings.replace_re.replace_re(Column input, RegexProgram pattern, Scalar replacement=None, size_type max_replace_count=-1, stream=None, DeviceMemoryResource mr=None) Column#
For each string, replaces any character sequence matching the given patterns with the provided replacement.
For details, see
replace_re()- Parameters:
- inputColumn
Strings instance for this operation.
- pattern: RegexProgram
The regex to match to each string and replace.
- replacementScalar
The string used to replace the matched sequence in each string.
- max_replace_countint
The maximum number of times to replace the matched pattern within each string. Default replaces every substring that is matched.
- Returns:
- Column
New strings column
- pylibcudf.strings.replace_re.replace_with_backrefs(Column input, RegexProgram prog, str replacement, stream=None, DeviceMemoryResource mr=None) Column#
For each string, replaces any character sequence matching the given regex using the replacement template for back-references.
For details, see
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.