fork download
  1. x <- c('SEF001DT45','BV004MF')
  2. results <- regmatches(x, regexpr('[A-Z]{2}.*?\\K[A-Z]{2}', x, perl=TRUE))
  3. results
Success #stdin #stdout 0.32s 39028KB
stdin
Standard input is empty
stdout
[1] "DT" "MF"