I am practicing with regular expressions in R. I would like to extract the last occurrence of two upper case letters. I tried
>str_extract("kjhdjkaYY,","[:upper:][:upper:]")
[1] "YY"
And it works perfectly fine. What if I would like to extract the last occurrence of such pattern. Example:
function("kKKjhdjkaYY,")
[1] "YY"
Thank you for your help