I am not sure of being in a position to commit to doing this. For me, doing
so would make it "a matter of honor" to work on it regardless. A weird
aspect of my personality, I guess.

In any case, I don't know of any way to actually integrate PCRE into REXX.
It would be neat to be able to do something like:

PARSE VAR SOMEDATA PCRE'...' MATCH1 MATCH2

But that is not possible. So I'm wondering what syntax should be used? I
can think of two possibilities. One is easier to implement than the second.
But the second is more REXX-like.

The easier to implement would be something like:

CALL *(REXXPCRE) 'PCRE VARTOPARSE MATCH1 MATCH2 '

Where REXXPCRE is passed a list of names. The first contains the string
which is the PCRE expression. The second is the data to parse. The rest are
names of variables to be created or updated by REXXPCRE with the data
matched by the n-th "capture group". If there are more variables than
capture groups matched, I guess I could set the extra to '' (null). Thats'
basically what PERL does. Another thought, or as an alternate to the above
would be to use a stem as in:

CALL *(REXXPCRE) 'PCRE VARTOPARSE MATCH."

Where MATCH.0 would equal the number of matches returned in MATCH.1,
MATCH.2 and so on. If no matches, then MATCH.0==0.

I am wondering about the return code as well. For the first, I would guess
that I could return a positive number which would be the number of matches
and a negative number if an error occurred.

===

The more difficult, but "REXXier" way would be to do like SDSF does, or
z/OS UNIX and set up an ADDRESS PCRE environment. But I would then need to
figure out the syntax of the PCRE environment commands.

rc=pcrecall("ON") /* Establish PCRE command environment */
ADDRESS PCRE
"(X)=M/.../" /* DO A MATCH AGAINST THE IMPLIED VARIABLE _ */
/* return match in X*/
"(A,B)=VAR=~M/.../"
/* scan VAR, return first two matches in A and B */
"C=M/.../' " /* DO MATCH AGAINST _ */
/* RETURN COUNT OF MATCHES IN C */
/* _ is default to be compatable with PERL */
"(X)=S/pcre-to-match/replacement/"
/* do substitution regexp on value in _, returning value in X

Basically, being a Perl user, tried to adapt the Perl syntax as a REXX
command environment.

Even if I assume that I am capable of writing the above, it is likely going
to take a while. If I "cheat" and do this at work in some spare time, all I
can use is HLASM. No, I'm not going to write it in COBOL! <grin/>. I might
be able to use C on a different system, but that would be nights and
weekends from home only. I normally take weekends off "dead to the world".
And my dog gets royally upset if I stay at my computer very long.

On Sun, Jul 7, 2013 at 11:42 AM, Ze'ev Atlas <[email protected]> wrote:

> >do I have the talent and do I have the commitment.
>
> I am sure you do have the first
> Please contact me of the group if you decide that you have the second.
> ZA
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>



-- 
This is a test of the Emergency Broadcast System. If this had been an
actual emergency, do you really think we'd stick around to tell you?

Maranatha! <><
John McKown

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

Reply via email to