xchar_gsub <- function(x, start_character, stop_character, pattern, repalcement){
a <- regexpr(start_character, x)
b <- regexpr(stop_character, x)
y <- substr(x, a, b)
z <- gsub(pattern, repalcement, y)
m <- sub(y, z, x)
return(m)
}
R语言 字符串某一段的正则表达式替换
最新推荐文章于 2022-10-21 15:48:23 发布