I've been trying to match a pattern excluding a certain char.
Lets say the characters given is "h...o", and I want to match all words not including a certain char, let's say 'c' I've tried a ton of different ways of going about this. Some of those include,
"h^[c]^[c]^[c]o"
"h(!?c)(?!c)(!?c)o"
But none of those works, does anyone know whats up?
the point of this is kind of like a cheating hang man, where I return all the words not containing the guess.
vector<string> getWords(string currentWord, char guess){
for(auto& i: currentWord){
string reg = ""
if(i == '_'){
string t = [[regex expression for acception any char except 'guess']]
reg += t;
}else{
reg += i;
}
}
return getMatchingWords(mapOfWords, reg)
}
Only accepting all words that doesn't contain the guess doesn't work here as the exclusion is indexbound