R/utils.R

Defines functions namer get_comment is.regex

namer <- function(x, ...){
    if (is.null(names(x))) names(x) <- rep("", length(x))
    x
}
 

get_comment <- function(x, ...) {
     attributes(x)[["comment"]]
}


is.regex <- function (pattern) {
    out <- suppressWarnings(try(gsub(pattern, "", "hello", perl = TRUE), 
        silent = TRUE))
    ifelse(inherits(out, "try-error"), FALSE, TRUE)
}

Try the regexr package in your browser

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

regexr documentation built on May 29, 2017, 5:57 p.m.