fork(1) download
  1. x <- c('SEF001DT45','BV004MF')
  2. library(stringr)
  3. results <- stringr::str_match(x, '[A-Z]{2}.*?([A-Z]{2})')
  4. results[,2]
Success #stdin #stdout 0.29s 42032KB
stdin
Standard input is empty
stdout
[1] "DT" "MF"