In C, how do you capture a group with regex?
- by Sylvain
Hi,
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 ...
For instance, let the pattern be something as simple as "MAIL FROM:<(.*)>"
(with REG_EXTENDED cflags)
I want to capture everything between '<' and ''
My problem is that regmatch_t gives me the boundaries of the whole pattern (MAIL FROM:<...) instead of just what's between the parenthesis ...
What am I missing ?
Thanks in advance,