Se entendi corretamente o teu problema, não é necessário utilizar uma regex:

test <- c("SPA100", "MSA200", "MSB300", "MSC400", "MSC500", "PRA100", "PRC200", "MGV100", "MTJ400", "MTK500")

grep("MS", test, val=T, invert=T)



2016-10-04 9:49 GMT-03:00 Éder Comunello via R-br <r-br@listas.c3sl.ufpr.br>:
Senhores, bom dia!

Considerando o vetor:

test <- c("SPA100", "MSA200", "MSB300", "MSC400", "MSC500",
          "PRA100", "PRC200", "MGV100", "MTJ400", "MTK500")

Posso obter facilmente os valores iniciados com a sequência "MS":
grep("^MS", test, val=T)
# [1] "MSA200" "MSB300" "MSC400" "MSC500"

Uma primeira tentativa, sem sucesso, para obter linhas que não iniciam com a sequência foi:
grep("^!(MS)", test, val=T)
character(0)

Consegui uma solução estranha com:
grep("^[^M]|^M[^S]", test, val=T)
# [1] "SPA100" "PRA100" "PRC200" "MGV100" "MTJ400" "MTK500"

Mas essa solução é limitada quando usando strings maiores, tal como "MSC". 

Embora existam alternativas como:
test[-grep("^MSC", test)]
# [1] "SPA100" "MSA200" "MSB300" "PRA100" "PRC200" "MGV100" "MTJ400" "MTK500"

Gostaria de saber se há uma forma fácil de fazer isso usando diretamente uma regexp.

Grato,

================================================
Éder Comunello
Researcher at Brazilian Agricultural Research Corporation (Embrapa)
DSc in Agricultural Systems Engineering (USP/Esalq)
MSc in Environ. Sciences (UEM), Agronomist (UEM)
---
Embrapa Agropecuária Oeste, Dourados, MS, Brazil |<O>|
================================================
GEO, -22.2752, -54.8182, 408m
UTC-04:00 / DST: UTC-03:00




_______________________________________________
R-br mailing list
R-br@listas.c3sl.ufpr.br
https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br
Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forneça código mínimo reproduzível.



--
Marcus Nunes
http://marcusnunes.me/