R Wyodrębnij Regex z String

library(stringr)

x <- "aaaaa345aaa"
str_extract(x, "[1-9]+")
# [1] "345"
Matthew David