I\'m trying to extract a string from another using regex.
I\'m using the POSIX regex functions (regcomp, regexec ...), and I fail at capturing a group ...
F
The 0th element of the pmatch array of regmatch_t structs will contain the boundaries of the whole string matched, as you have noticed. In your example, you are interested in the regmatch_t at index 1, not at index 0, in order to get information about the string matches by the subexpression.
If you need more help, try editing your question to include an actual small code sample so that people can more easily spot the problem.