#include #include int main() { regex_t regtmp; if(regcomp (®tmp,"(.+)upper\\1^", REG_EXTENDED|REG_ICASE | REG_NOSUB )==0) { regmatch_t pmatch[1]; regexec(®tmp, "upperupperupperx",1, pmatch, 0); regfree(®tmp); } }