R/regex_funs.R

Defines functions which_regexp

# Copyright 2021 (c) Cogstate Ltd

which_regexp <- function(vals, regexs) {
  m <- lapply(regexs, function(r) grep(r, vals, ignore.case = TRUE))
  as.integer(utils::stack(stats::setNames(m, seq_along(m)))[,1])
}
WhiteJP/jpw documentation built on April 17, 2025, 5:47 a.m.