Quantcast
Channel: openSUSE Forums
Viewing all articles
Browse latest Browse all 40713

C regex matching problem

$
0
0
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:

Code:

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:
Code:

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.)

Viewing all articles
Browse latest Browse all 40713

Trending Articles