x <- c("not line_start 1 abc 2 def 4", "line_start 1 abc 2 def 4")
regmatches(x, gregexpr("(?:\\G(?!^)|^line_start)\\D*\\K\\d+", x, perl=TRUE))
eCA8LSBjKCJub3QgbGluZV9zdGFydCAxIGFiYyAyIGRlZiA0IiwgImxpbmVfc3RhcnQgMSBhYmMgMiBkZWYgNCIpCnJlZ21hdGNoZXMoeCwgZ3JlZ2V4cHIoIig/OlxcRyg/IV4pfF5saW5lX3N0YXJ0KVxcRCpcXEtcXGQrIiwgeCwgcGVybD1UUlVFKSk=