Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jun 2005 09:28:19 +0200
From:      Titus von Boxberg <ut@bhi-hamburg.de>
To:        Olivier Nicole <on@cs.ait.ac.th>
Cc:        questions@freebsd.org
Subject:   Re: Using regex(3)
Message-ID:  <42B91313.9050807@bhi-hamburg.de>
In-Reply-To: <200506220411.j5M4BQ6G087888@banyan.cs.ait.ac.th>
References:  <200506220411.j5M4BQ6G087888@banyan.cs.ait.ac.th>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42B91313.9050807>