regex_t reg;
int value;
int return_value;
value = regcomp(®, "^[2-9]+#*", REG_EXTENDED);
if (value == 0){
return_value = regexec(®, nums, 0, NULL, 0);
}
When I pass in nums = "2 23", with that space in the middle, the regexec returns a 0, or a match. Confused as to how to correct the regex or the C code itself to fix this.
I want the regex to be that so that only digits 2-9 are accepted, followed by any number of pound signs. No other symbols, or no pound signs at the beginning.