string <- "VNYTQAKENGSD"z <- gregexpr("N[A-OQ-Z][ST][A-OQ-Z]", string)z[[1]][1:length(z[[1]])]
Standard input is empty
[1] 2 9
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!