Can someone please teach me how to extract a regex match and print it out? For example, say my string is "abcdef" and I've setup a regex for "abc" (as below). It will match, but how do I extract and print the matched text?
char string1 = "abcdef";
regex_t * myregex = calloc(1, sizeof(regex_t));
rc = regcomp(myregex, "(abc)", REG_EXTENDED);