int main(void) {
char* mystring = "This was foo, and I mean foo.";
char* pattern = "fo{2}";
mystring,
pattern,
"replaced",
0
);
if (!replaced) return EXIT_FAILURE;
printf("%s\n", replaced);
free(replaced);
mystring,
pattern,
REG_ICASE
);
if (!replaced) return EXIT_FAILURE;
printf("%s\n", replaced);
free(replaced);
mystring,
pattern,
" ",
),
0
);
if (!replaced) return EXIT_FAILURE;
printf("%s\n", replaced);
free(replaced);
char* mytemplate =
"This REDis " NC "kinda REDuseful?" NC;
mytemplate,
"RED",
0
);
if (!replaced) return EXIT_FAILURE;
printf("%s\n", replaced);
free(replaced);
return EXIT_SUCCESS;
}