[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Adam T. Bowen
Tue, 29 Oct 2002 15:59:16 +0000 (GMT)
I am having some difficulty with the regex functions (regexec,
regcomp) in libc version 2.2.93 compiling with gcc version 3.2. The code
is as follows :
int main(int argc, char **argv)
while(regexec(&RE, &Test_String[Pos], (size_t)1, RM, 0) == 0)
printf("Match from %ld to %ld\n",Pos+RM.rm_so,Pos+RM.rm_eo-1);
The output of this is :
Match from 0 to 7
If the regular expression is changed to "(t[^r]+z)" 'r' being another
character that isn't in the string, it outputs nothing, as expected.
Also, if I change the string to "testing" (the trailing newline removed)
and use it with the original regular expression "(t[^z]+z)" it also
outputs nothing, as expected. The same code using libc version 2.2.4
While I'm on, could I ask if anyone has any opinions of what is
better to use - as concerns speed, portability and development - gnu regex
functions or posix regex functions?
Thank you for your time.
|[Prev in Thread]
||[Next in Thread]|
- regex problem,
Adam T. Bowen <=