fork download
  1. vec <- c('1234', '+ 42', '1E+4', 'NR 12', '4.5E+04', '8.6E-02')
  2. res <- regmatches(vec, regexpr("[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?", vec))
  3. unlist(res)
Success #stdin #stdout 0.2s 185728KB
stdin
Standard input is empty
stdout
[1] "1234"    "42"      "1E+4"    "12"      "4.5E+04" "8.6E-02"