x <- "0,1 10 1000,29 3,23313" regmatches(x, gregexpr("\\d+(?:,\\d+)?", x))