I am trying to match same ('reference') letter only in a word. For example:

Makaraka

Wasagara

degenerescence

desilicification

odontonosology

There are 4 'a' in the first word, 6 'o' in the last one. How can I match all of then using RE? I tried using backreference, but I couldn't manage, the last "sample" letter was never matched. Is there a way to specify the number of occurrences for a capturing group? Thanks.