#include <stdio.h>
#include <regex.h>
int main() {
regex_t regex;
int retis;
char* str = "an:example";
retis = regcomp(®ex, "^[a-z]+:[a-z]+$", REG_EXTENDED);
retis = regexec(®ex, str, 0, NULL, 0);
if(!retis) {
}
else if(retis == REG_NOMATCH) {
}
regfree(®ex);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxyZWdleC5oPgoKaW50IG1haW4oKSB7CiAgIHJlZ2V4X3QgcmVnZXg7CiAgIGludCByZXRpczsKICAgY2hhciogc3RyID0gImFuOmV4YW1wbGUiOwogICAKICAgcmV0aXMgPSByZWdjb21wKCZyZWdleCwgIl5bYS16XSs6W2Etel0rJCIsIFJFR19FWFRFTkRFRCk7CiAgIHJldGlzID0gcmVnZXhlYygmcmVnZXgsIHN0ciwgMCwgTlVMTCwgMCk7CiAgIAogICBpZighcmV0aXMpIHsKICAgICAgcHV0cygiTWF0Y2giKTsKICAgfQogICBlbHNlIGlmKHJldGlzID09IFJFR19OT01BVENIKSB7CiAgICAgIHB1dHMoIk5vIG1hdGNoIik7CiAgIH0KICAgCiAgIHJlZ2ZyZWUoJnJlZ2V4KTsKICAgcmV0dXJuIDA7Cn0=