I'm trying to regex match words with repeat characters using this link as one reference among others:
regex - excluding words with consecutive repeat characters - Stack Overflow
The link is not C++ tagged and I'm trying to make a C++ regex compliant version based on above (and other material) which I'm having a hard time with. The program below shows some of my efforts so far and any help would be much appreciated, thanks:Code:#include <iostream> #include <regex> #include <string> int main() { // std::regex re ("(A-Za-z0-9){1}"); std::regex re ("(.)(?!\1)"); std::string input; getline(std::cin, input); std::regex_match(input, re) ? std::cout << "Non-unique" : std::cout << "Unique"; std::cout << '\n'; }