I have a vector of strings with the following format "IN_D44_A09_ET" and I would like to extract the number 9 using the stringr package.
I have been trying to solve it using str_extract(), but I don't get how to formulate the pattern.
values <- c("IN_D44_A09_CT", "XE_D34_A15_ET")
str_extract(values, "_A(\\d+)")
This pattern extracts "_A09" and "_A15" but what I want is "9" and "15".