fork download
  1. regmatches("line_start 1 abc 2 def 4", gregexpr("(?:\\G(?!^)|^line_start)\\D*\\K\\d+", "line_start 1 abc 2 def 4", perl=TRUE))
  2. library(stringr)
  3. stringr::str_extract_all("line_start 1 abc 2 def 4", "\\G\\D*?(\\d+)")
Success #stdin #stdout 0.24s 42364KB
stdin
Standard input is empty
stdout
[[1]]
[1] "1" "2" "4"

[[1]]
[1] "line_start 1" " abc 2"       " def 4"