Using regex(3)

Titus von Boxberg ut at bhi-hamburg.de
Wed Jun 22 07:30:59 GMT 2005


Olivier Nicole schrieb:
> Hi,
> 
> I must missunderstand how to use regex(3).
no, you're misunderstanding regoff_t or printf.
it's a 64 bit type. thus your printf should read:

ret=regexec(preg, string, nmatch, pmatch, 0);
printf("return from regexec=%d\nnmatch=%d\np0.so=%lld p0.eo=%lld\np1.so=%lld
         p1.eo=%lld\np2.so=%lld p2.eo=%lld\np3.so=%lld p3.eo=%lld\n",
                 ret, nmatch,
                 pmatch[0].rm_so, pmatch[0].rm_eo,
                 pmatch[1].rm_so, pmatch[1].rm_eo,
                 pmatch[2].rm_so, pmatch[2].rm_eo,
                 pmatch[3].rm_so, pmatch[3].rm_eo );

regards
titus


More information about the freebsd-questions mailing list