I have the following vector and I want to have the subscript numbers (e.g. ₆, ₂) to be replaced with 'normal' numbers.
vec = c("C₆H₄ClNO₂", "C₆H₆N₂O₂", "C₆H₅NO₃", "C₉H₁₀O₂", "C₈H₈O₃")
I could lookup all subscript values and replace them individually:
gsub('₆', '6', vec)
But isn't there a pattern in regex for it?
There's a similar question for javascript but I couldn't translate it into R.