b <- c("Average 18.24", "Error 23.34")sub("^[A-Za-z]+[[:space:]]+", "", b)sub("^\\S+\\s+", "", b)
Standard input is empty
[1] "18.24" "23.34" [1] "18.24" "23.34"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!