fork download
  1. library(stringr)
  2. vec <- c("SHVANSGYMGMTPRLGLESLLE*A*MIRVASQ")
  3. matches <- stringr::str_match_all(vec, "(?=(M[^*]*)\\*)")
  4. unlist(lapply(matches, function(z) z[,2]))
Success #stdin #stdout 0.29s 41960KB
stdin
Standard input is empty
stdout
[1] "MGMTPRLGLESLLE" "MTPRLGLESLLE"