R/identifyReplacementVariables.R

Defines functions identifyReplacementVariables

Documented in identifyReplacementVariables

identifyReplacementVariables <- function(filename_s) {
  l <- lapply(filename_s, function(f) {
    if (!file.exists(f)) abort(paste(f, 'is not an existing file'))
    r <- readLines(f, warn = FALSE)
    unlist(
      Filter(function(e) length(e) > 0,
             regmatches(r, gregexpr('XXX_[\\d]{3}', r, perl = TRUE)))
    )
  })
  names(l) <- filename_s
  l
}

Try the wyz.code.rdoc package in your browser

Any scripts or data that you put into this service are public.

wyz.code.rdoc documentation built on Oct. 6, 2021, 9:07 a.m.