As you said "need a regex", I thought I would only present the "pure" regex without worrying about the language, but I would have to test it somehow, so I developed it in python (I have this regex here in my "Knowledge Base" for years, is not my own), I think it will be easy to pour into the c.
Regex
regex = (?=[b-df-hj-np-tv-xz])(.)(?!)(?<!)
Explaining the parts:
(?=[b-df-hj-np-tv-xz]) Casa somente com consoantes
(.) A "gula" na regex, considera todas.
(?!) e (?<!) Evita duplicidade no final
Implementation in python:
See code execution on repl.it.
import re
var = 'algoritmo'
r1 = r'(?=[b-df-hj-np-tv-xz])(.)(?!)(?<!)'
result = re.findall(r1, var)
consonants = ''.join(str(e) for e in result)
print (consonants.split(' ')[0])
lgrtm
Actually the regex gives the result you need but not doing the way you suggest, that is, instead of identifying the vowels and removing them, it returns only the consonants.
DEMO
Edited Version without regex:
I do not have time and on a very limited machine, so I developed a python version without the use of regex, I think it would be easy to convert to C if you want to try the repl I try to help.
vogais = ['a', 'e', 'i', 'o', 'u']
string = 'Algoritmo'
result = ''
# Percorre todas as letras da string
for x in string:
# convert p/ minúscula e verifica se esta em vogais
if x.lower() not in vogais:
# se NÃO estiver em vogais, adiciona na string resultante
result += x
# Imprime o resultado
print (result)
lgrtm
View execution on repl.it.