Skip to contents

Replace Pattern Occurrences

Usage

replace_regex(x, p, r)

Arguments

x

<character> vector; strings to search in

p

<character> vector; search patterns

r

<character> vector with replacements for matched patterns

Value

<character> vector

Examples

replace_regex(c('stringi R', 'REXAMINE', '123'), '( R|R.)', ' r ')
#> [1] "stringi r " " r XAMINE"  "123"