0

I have this vector of strings :

strings <- c("5 EUR 12 EUR", "5 ESCALOPE", "5 E", "87 TOYS")

and I just want to GET the element : 5 E

I tried some regex like this one :

grep("[0-9] E", strings, value = TRUE)

It returns this : "5 EUR 12 EUR" "5 ESCALOPE" "5 E"

What I want is a "number and E" and anything else after the E, no spaces, no \n, \t, ...

If someone has the solution ... thx ^^

0 Answers0