sub("\\S+\\.\\K\\d{2}(?=\\S)", "", "ACC_OR.A5J1.01A", perl=TRUE)
Standard input is empty
[1] "ACC_OR.A5J1.A"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!