C regex matching problem

Hello the code is located at http://susepaste.org/74036237 due to it’s length.
I’m trying to preform a grep like function on text and can’t seem to figure out how to find what part of the text matched. The code compiles without a problem. I get:


Number of sub expressions is 1
Regerror reports Success
Part of match: is is string numb
Part of match: is is string numb

And when I change the string so that it does not match I get:


Number of sub expressions is 1
No match.
Regerror reports No match
Part of match: 
Part of match:

Now the string does not contain two occurrences of “is”, so what’s up?
I tried solving this one for myself by downloading the source for grep but it does not use the glibc facilities for printing what parts of a string match (and the sources are quite large.)

Now the string does not contain two occurrences of “is”

It does. Why do you expect “is” to be a separate word? Look more closely.

:shame: Ha! Ha! Your right! Boy, I should have seen that one easy.