R/regex_content_parameter.R

Defines functions regex_content_parameter

Documented in regex_content_parameter

#' Construct Regex for Matching Function Parameter Content
#'
#' This function constructs a regex pattern for matching the content of a parameter in a function.
#' It uses the `base::paste0` function to construct the regex pattern.
#'
#' @param parameter The parameter whose value is to be searched in a function.
#' @return A regex pattern as a character string.
#' @examples
#' # Create a parameter name
#' parameter <- "my_parameter"
#' # Construct a regex pattern for matching the content of the parameter
#' pattern <- regex_content_parameter(parameter)
#'
#' @export
regex_content_parameter <- function(parameter) {
  base::paste0(
    "(?<=",
    parameter,
    "\\s{0,20}\\=\\s{0,20}\").*"
  )
}

Try the vvauditor package in your browser

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

vvauditor documentation built on May 29, 2024, 12:20 p.m.