#include <stdio.h> #include <regex.h> #include <mhash.h> int main() { regex_t rgx; char *pattern = "^[[:alnum:]]*$"; char *str = "shabi"; if (regcomp(&rgx, pattern, REG_EXTENDED | REG_NOSUB) != 0) { perror("Invalid regex pattern"); regfree(&rgx); exit(EXIT_FAILURE); } if (regexec(&rgx, str, 0, NULL, 0) == 0) { printf("Match success "); } else { printf("Match failed "); } regfree(&rgx); return 0; }