You are completely overthinking this.
regex_t re;
char file[] = "hello777world99yew 8 I8909do23!";
const char *p = file;
regmatch_t match;
if(regcomp(&re, "[0-9]+", REG_EXTENDED) != 0)...
Type: Posts; User: cas
You are completely overthinking this.
regex_t re;
char file[] = "hello777world99yew 8 I8909do23!";
const char *p = file;
regmatch_t match;
if(regcomp(&re, "[0-9]+", REG_EXTENDED) != 0)...
regexec() will not find multiple instances of your parenthesized expression. There are multiple elements in pmatch because you can have multiple sets of parentheses, not for any other reason.
...