sub( "^\\D*(\\d)", "\\1", "DitchMe5KeepMe" )sub( "^\\D*(?=\\d)", "", "DitchMe5KeepMe", perl=TRUE)
Standard input is empty
[1] "5KeepMe" [1] "5KeepMe"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!