Skip to content

Commit f62d5c9

Browse files
committed
also exclude x$variable
1 parent af692c8 commit f62d5c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/snakeToCamel.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ snakeToCamel <- function(pathToFile, ask = TRUE) {
3838
}
3939
message(variables[[i]], " -> ", replacements[[i]])
4040
if (!ask || askYesNo("replace?")) {
41-
lines <- gsub(paste0('(?<!["', "'])\\b", variables[[i]], "\\b"), replacements[[i]], lines, perl = TRUE)
41+
lines <- gsub(paste0("(?<![\"$'])\\b", variables[[i]], "\\b"), replacements[[i]], lines, perl = TRUE)
4242
writeLines(lines, pathToFile)
4343
}
4444
}

0 commit comments

Comments
 (0)