我有这样的字符串:
years<-c("20 years old", "1 years old")
我想只grep这个向量中的数字.预期输出是一个向量:
c(20, 1)
我该怎么做呢?
regex r
r ×1
regex ×1