Re: Using regex(3)

2005-06-23 Thread Dmitry Mityugov
On 6/23/05, Olivier Nicole [EMAIL PROTECTED] wrote: Thanks Titus, no, you're misunderstanding regoff_t or printf. I definitely misunderstand printf. Until now I thought that each place holder (%d) was associated with one variable and if the type missmatched, the display could be

Re: Using regex(3)

2005-06-22 Thread Olivier Nicole
I must missunderstand how to use regex(3). To add a bit, running the same program on Linux gives the expected results: regexpr=a(.)c number of substrings=1 return from regexec=0 nmatch=0 p0.so=0 p0.eo=0 p1.so=0 p1.eo=0 p2.so=0 p2.eo=0 p3.so=0 p3.eo=0 return from regexec=0 nmatch=1 p0.so=0

Re: Using regex(3)

2005-06-22 Thread Titus von Boxberg
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

Re: Using regex(3)

2005-06-22 Thread Olivier Nicole
Thanks Titus, no, you're misunderstanding regoff_t or printf. I definitely misunderstand printf. Until now I thought that each place holder (%d) was associated with one variable and if the type missmatched, the display could be incorrect. But in that case, printf seems to take 2 successive %d

Using regex(3)

2005-06-21 Thread Olivier Nicole
Hi, I must missunderstand how to use regex(3). From what I read in the man page, pmatch[i].rm_so is the begining of the i-th match in the regular expression and pmatch[i].rm-so is the end. So if I try to match the regex a(.)c on the string abc I should have: pamtch[1].rm_so=1 and