R/utils.R

Defines functions fixed_grep fast_grep

#Wrappers around grepl optimised for fixed-string pattern-matching and
#fast pattern-matching, respectively.
fixed_grep <- function(field, pattern){
  grepl(x = field, pattern = pattern, fixed = TRUE, useBytes = TRUE)
}
fast_grep <- function(field, pattern){
  grepl(x = field, pattern = pattern, useBytes = TRUE, perl = TRUE)
}
wikimedia-research/pageviews documentation built on May 4, 2019, 5:24 a.m.