On Sun, Feb 15, 2015 at 9:55 AM, Ze'ev Atlas <
[email protected]> wrote:

> Hi allI am trying to create a common interface between COBOL and the
> runtime C library, especially the RegEx related functions.
> The regex.h header file indicates that the regmatch_t structure consists
> of two long variables (i.e. two pic s9(18) comp-5.).  This structure is
> used as an element of an array of such elements for however reasonable
> amount needed.When I call the regexec function, it looks like the program
> returns as the first component of the first element only int (i.e. PIC
> s9(9) COMP-5.).  All other components of that element and subsequent ones
> are correct.
> For example, I was supposed to get (0,15),(8,2)so I get
> 00000000  000000000000000F
> 0000000000000002  0000000000000008
> instead of
> 0000000000000000  000000000000000F
> 0000000000000002  0000000000000008
> Does anybody have a clue about why do I get such a bizarre behavior.
>    Ze'ev Atlas
>


I'm sure you have already looked at these.  In case you have not, double
check them.

Is nmatch set to 0 or REG_NOSUB in the call to regcomp()?  If yes, then
pmatch is undefined.

EREG_NOSUB also influences array returned in pmatch.

regmatch_t also has an alternate structure which contains shift state
information.



>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to