Skip to content

Commit af692c8

Browse files
committed
snakeToCamel does not replace at the start of string
1 parent a740453 commit af692c8

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)
41+
lines <- gsub(paste0('(?<!["', "'])\\b", variables[[i]], "\\b"), replacements[[i]], lines, perl = TRUE)
4242
writeLines(lines, pathToFile)
4343
}
4444
}

0 commit comments

Comments
 (0)