regex_t preg;
char *regex = strdup(pattern + 1);
regex[length - 2] = '\0';
if (regcomp(&preg, regex, REG_EXTENDED | REG_ICASE) != 0) {
regex_t preg;
char *regex = strdup(pattern + 1);
regex[length - 2] = '\0';
if (regcomp(&preg, regex, REG_EXTENDED | REG_ICASE) != 0) {