fork download
  1. x <- "123456789
  2. kfasdf 3456789asdf
  3. a 1
  4.  
  5. 12345 789
  6. 1 9
  7. a 678a"
  8. regmatches(x, gregexpr("(?<![\\d\\h])(?>\\d|(?<!\\d)\\h){8}\\d", x, perl=TRUE))
Success #stdin #stdout 0.24s 39224KB
stdin
Standard input is empty
stdout
[[1]]
[1] "123456789" "  3456789" "        1"