a="1.1G;1.2 G;1.435 G;1.1 G;1.5555G"stringr::str_extract_all(a, "\\d+(?:\\.\\d+)?(?=\\s*G\\b)")
Standard input is empty
[[1]] [1] "1.1" "1.2" "1.435" "1.1" "1.5555"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!