I need to replace all the accents in the 5 vowels of the Spanish alphabet using a single replacement regex and 5 capture groups.
In my text I have áéíóúàèìòù and so on. Until now I have this regex:
s/(=?[àáÀÁ])|(=?[èéÈÉ])|(=?[ìíÌÍ])|(=?[òóÒÓ])|(=?[ùúÙÚ])/$1$2$3$4$5/g
But this regex gives me the same result on each group.
Is there a way of getting a different value on each of the different group? Like so:
group1 ($1)-> A
group2 ($2) -> E
group3 ($3) -> I
group3 ($4) -> O
group3 ($5) -> U
I know how to do this using 5 different regex, but I need to do this in just one. Any thoughts?
Thank you very much!!