I need a function or more likely a regex script that will allow me to pick out text strings based on a condition.
Example:
Input <- c("Red1 Orange", "Yellow Green2", "Blue3 Violet")
Leads to: "Red1", "Green2", "Blue3"
I have tried variety of options including:
str_extract(NamesCor, "[a-z][a-z][a-z][a-z][0-9]|
[a-z][a-z][a-z][0-9]|
[a-z][a-z][0-9]")
Which returns reen2, blue3