#include <stdio.h>
#include <regex.h>

int main() {
   regex_t regex;
   int retis;
   char* str = "an:example";
   
   retis = regcomp(&regex, "^[a-z]+:[a-z]+$", REG_EXTENDED);
   retis = regexec(&regex, str, 0, NULL, 0);
   
   if(!retis) {
      puts("Match");
   }
   else if(retis == REG_NOMATCH) {
      puts("No match");
   }
   
   regfree(&regex);
   return 0;
}