fork(1) download
  1. x <- c("not line_start 1 abc 2 def 4", "line_start 1 abc 2 def 4")
  2. regmatches(x, gregexpr("(?:\\G(?!^)|^line_start)\\D*\\K\\d+", x, perl=TRUE))
Success #stdin #stdout 0.22s 39532KB
stdin
Standard input is empty
stdout
[[1]]
character(0)

[[2]]
[1] "1" "2" "4"