text_replace_group: function for replacing regex group matches generic for...

Description Usage Arguments

View source: R/text_replace_group.R

Description

function for replacing regex group matches generic for getting regex group matches

text_replace_group default

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
text_replace_group(
  string,
  pattern,
  replacement,
  group = seq_along(replacement),
  invert = FALSE,
  ...
)

## Default S3 method:
text_replace_group(
  string,
  pattern,
  replacement,
  group = TRUE,
  invert = FALSE,
  ...
)

Arguments

string

text from which to extract character sequence

pattern

regex to be searched for

replacement

character vector of replacements of length 1 or length(group) to replace regex group matches (marked character spans provided by the found parameter)

group

vector of integers identifying thos regex groups to be replaced

invert

should character spans provided by found or their counterparts be replaced

...

further parameter passed through to grep


stringb documentation built on Jan. 26, 2021, 1:07 a.m.