SparkR (version 2.1.2)

regexp_replace: regexp_replace

Description

Replace all substrings of the specified string value that match regexp with rep.

Usage

regexp_replace(x, pattern, replacement)

# S4 method for Column,character,character regexp_replace(x, pattern, replacement)

Arguments

x

a string Column.

pattern

a regular expression.

replacement

a character string that a matched pattern is replaced with.

See Also

Other string_funcs: ascii, base64, concat_ws, concat, decode, encode, format_number, format_string, initcap, instr, length, levenshtein, locate, lower, lpad, ltrim, regexp_extract, reverse, rpad, rtrim, soundex, substring_index, translate, trim, unbase64, upper

Examples

Run this code
# NOT RUN {
regexp_replace(df$c, '(\\d+)', '--')
# }

Run the code above in your browser using DataLab