Examples for 'xfun::grep_sub'


Perform replacement with 'gsub()' on elements matched from 'grep()'

Aliases: grep_sub

Keywords:

### ** Examples

# find elements that matches 'a[b]+c' and capitalize 'b' with perl regex
xfun::grep_sub("a([b]+)c", "a\\U\\1c", c("abc", "abbbc", "addc", "123"), perl = TRUE)
[1] "aBc"   "aBBBc"

[Package xfun version 0.49 Index]