fork(1) download
  1. x <- c('SEF001DT45','BV004MF')
  2. sub('.*?[A-Z]{2}.*?([A-Z]{2}).*', '\\1', x)
Success #stdin #stdout 0.3s 38840KB
stdin
Standard input is empty
stdout
[1] "DT" "MF"