N <- 3e6
set.seed(1)
LL <- c(LETTERS, "", " ", "ZZ")
for (i in seq(4))
	LL <- paste0(sample(LL, 36, TRUE), sample(c("", "A", "B", " "), 36 ,TRUE), sample(LL, 36, TRUE))
DT.TEST <- data.table(id=sample(c("AA", "BB", "CC", "DD"), N, TRUE), strng=sample(LLLL, N, TRUE), val1=rnorm(N), val2=runif(N, 1e4, 1e5))
DT.TEST


GREP <- quote(DT.TEST[grep("GBZZEF", strng, ignore.case=TRUE), 1])
GREPL <- quote(DT.TEST[grepl("GBZZEF", strng, ignore.case=TRUE), 1])

mbench(GREP, GREPL, unit="nanoseconds")



       Measuring 'elapsed' time.                                                
       Units: milliseconds                           Number of Repetitions: 28  
                                                                                
          Expr       relative      Median Time       MAD      (2xMAD)/Median    
      ------------|-------------|----------------|---------|------------------- 
         GREP            1            344.35        3.54           2.1 %        
         GREPL         1.065          366.83        2.77           1.5 %        
         