I'd like to extract the numerical values from a string, for example:
x <- c("14 trucks and 3298 pounds of tuna",
"228 gallons and 190 pounds of sand",
"161751 barrels gell, 3438540 pounds proppant",
"29 pounds of hay, 100 barrels of water, 30 pins")
I would like to extract the numbers (numerical) only before the word pounds
, and the result after the operation should be
c(3298, 190, 3438540, 29)