Bruce Korb <yyyyy@xxxxxxxxxxx> wrote, on 21 May 2004:
>
> > A better example would be the string "ababa" with the same BRE, but
> > it's all basically the same issue.
>
> Using:
> > printf("<%s|%s> (%3d -> %3d) (%3d -> %3d)\n", strs[1], strs[2],
> > match[1].rm_so, match[1].rm_eo, match[2].rm_so,
>match[2].rm_eo);
> > $ echo ababa | ./re
> > <a|b> ( 2 -> 3) ( 1 -> 2)
I suspect this was still using the string "aba" that was hardcoded
in Nick's test program, rather than the string provided on stdin.
If you change the string to "ababa" you should get (4 -> 5) (3 -> 4)
as the matches.
--
Geoff Clare <yyyyyyy@xxxxxxxxxxxxx>
The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England
|