Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Regular Expressions with Rexx

532 views
Skip to first unread message

Farley, Peter x23353

unread,
Oct 10, 2017, 6:34:58 PM10/10/17
to
I for one would be quite happy for a PCRE API from z/OS Rexx.

I am much more familiar with GNU ERE's than with PCRE's from extensive gawk (GNU awk) practice and experience. I get confused by the differences. And I miss the GNU ERE "character class" components (like [[:alpha:]], [[:digits:]], [[:xdigits:]], etc.).

But it's never too late to learn new things.

Peter

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of Ze'ev Atlas
Sent: Tuesday, October 10, 2017 5:29 PM
To: TSO-...@VM.MARIST.EDU
Subject: Regular Expressions with Rexx

John Gateley and I will be publishing a full Rexx API to Perl Compatible Regular Expression package in z/OS, probably next week.  This release will be complete if somewhat primitive, comparing to the experimental 1st release.  I have noticed that there is not a lot of interest in that subject, which I understand, knowing the Rexx culture.  However many of you do Java, ooRexx and are exposed to regular expressions even in Rexx context.
I would like to get feedback about the whole subject and about the API (I will publish its availability on the same lists) Ze'ev Atlas

--


This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.

Ze'ev Atlas

unread,
Oct 10, 2017, 7:04:52 PM10/10/17
to
PeterPlease check CHARACTER CLASSES in the PCRE2 documentation.  They seem to be available.

from http://www.gnu.org/software/grep/manual/html_node/Regular-Expressions.html
(Note that we provide PCRE2)


3 Regular Expressions
A regular expression is a pattern that describes a set of strings. Regular expressions are constructed analogously to arithmetic expressions, by using various operators to combine smaller expressions. grep understands three different versions of regular expression syntax: “basic” (BRE), “extended” (ERE) and “perl” (PCRE). In GNU grep, there is no difference in available functionality between the basic and extended syntaxes. In other implementations, basic regular expressions are less powerful. The following description applies to extended regular expressions; differences for basic regular expressions are summarized afterwards. Perl-compatible regular expressions give additional functionality, and are documented in the pcresyntax(3) and pcrepattern(3) manual pages, but work only if PCRE is available in the system. Ze'ev Atlas
| | Virus-free. www.avast.com |


----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

Bob Bridges

unread,
Oct 13, 2017, 11:27:16 AM10/13/17
to
I used to venture gingerly into regular expressions, say once a year at most, when writing routines in VBA. But a couple of years ago I spent a tumultuous 18 months writing Excel spreadsheets for a bank RBAC project, and finally learned to employ them routinely. I'd be delighted to have the same thing in TSO-REXX. But I'm a contractor, flitting from client to client, so I'm unlikely to have access to such a package until it's part of the standard language.

ooREXX has regular expressions? That's one more reason for me to download it. Maybe it'll tip the balance.

---
Bob Bridges, cell 336 382-7313
robhb...@gmail.com
rbri...@InfoSecInc.com

/* Suppress friction and a machine runs fine. Suppress friction, and a society runs down. -John D MacDonald, in "A Deadly Shade of Gold" */


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of Farley, Peter x23353
Sent: Tuesday, October 10, 2017 18:35

I for one would be quite happy for a PCRE API from z/OS Rexx.

I am much more familiar with GNU ERE's than with PCRE's from extensive gawk (GNU awk) practice and experience. I get confused by the differences. And I miss the GNU ERE "character class" components (like [[:alpha:]], [[:digits:]], [[:xdigits:]], etc.).

But it's never too late to learn new things.

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of Ze'ev Atlas
Sent: Tuesday, October 10, 2017 5:29 PM


John Gateley and I will be publishing a full Rexx API to Perl Compatible Regular Expression package in z/OS, probably next week. This release will be complete if somewhat primitive, comparing to the experimental 1st release. I have noticed that there is not a lot of interest in that subject, which I understand, knowing the Rexx culture. However many of you do Java, ooRexx and are exposed to regular expressions even in Rexx context.
I would like to get feedback about the whole subject and about the API (I will publish its availability on the same lists) Ze'ev Atlas

David Crayford

unread,
Oct 16, 2017, 8:06:51 AM10/16/17
to
I wrote a TSO REXX regex command processor years ago
https://github.com/daveyc/RTK. It supports ECMAScript regex syntax
(C++11) which is close to PCRE but not identical. It's fast too as it
doesn't have the function call overhead of establishing an LE
environment on every call like other APIs. ECMAScript doesn't support
POSIX [:digit:] expressions, instead it uses /d which is far less
verbose. I posted it on here at the time but nobody was interested which
may be due to Bob's issue of having to install it at customer sites but
probably due to the lack of interest for regexes for TSO REXX.

David Crayford

unread,
Oct 16, 2017, 8:14:03 AM10/16/17
to
"ECMAScript doesn't support POSIX [:digit:] expressions"

    Actually that's not true it does
http://www.cplusplus.com/reference/regex/ECMAScript/#character_classes.

Ze'ev Atlas

unread,
Oct 16, 2017, 8:20:06 AM10/16/17
to
I will certainly look at itZA

Sent from Yahoo Mail on Android

On Mon, Oct 16, 2017 at 8:13 AM, David Crayford<dcra...@GMAIL.COM> wrote: I wrote a TSO REXX regex command processor years ago

Ze'ev Atlas

unread,
Oct 16, 2017, 8:45:49 AM10/16/17
to
Does your routine support those POSIX classes?
Obviously your idea has the advantages that you have mentioned and PCRE has the disadvantages in those aspects.  The advantage of PCRE is being a standard, fully maintained package that is Perl compatible, not only EMACS compatible.
The good news is that now we have choices, your routine and PCRE may 'compete'.  Choices are always good we are told.
BTW, for those who have it installed, IBM supply the 'standard' C library with the standard POSIX regex functions.  Somebody may follow our lead and code an API for those.  They are POSIX compliant and (need some research) may or may not meed LE.  If they do not need LE, then replacing your code with a very simple API that everybody can copy rather than install may solve the installation problem... and the client may not complain about using some non-standard code.
David, do you want to look into that option or should I?
Ze'ev Atlas

Sent from Yahoo Mail on Android

On Mon, Oct 16, 2017 at 8:16 AM, David Crayford<dcra...@GMAIL.COM> wrote: "ECMAScript doesn't support POSIX [:digit:] expressions"

John McKown

unread,
Oct 16, 2017, 9:36:51 AM10/16/17
to
On Mon, Oct 16, 2017 at 7:04 AM, David Crayford <dcra...@gmail.com> wrote:

> I wrote a TSO REXX regex command processor years ago
> https://github.com/daveyc/RTK. It supports ECMAScript regex syntax
> (C++11) which is close to PCRE but not identical. It's fast too as it
> doesn't have the function call overhead of establishing an LE
> environment on every call like other APIs. ECMAScript doesn't support
> POSIX [:digit:] expressions, instead it uses /d which is far less
> verbose. I posted it on here at the time but nobody was interested which
> may be due to Bob's issue of having to install it at customer sites but
> probably due to the lack of interest for regexes for TSO REXX.
>
>
​David,

I just cloned the above repository and all I saw as README.md in it. No
code.​


--
I just child proofed my house.
But the kids still manage to get in.


Maranatha! <><
John McKown

David Crayford

unread,
Oct 16, 2017, 10:17:09 PM10/16/17
to
On 16/10/2017 9:36 PM, John McKown wrote:
> On Mon, Oct 16, 2017 at 7:04 AM, David Crayford <dcra...@gmail.com> wrote:
>
> ​David,
>
> I just cloned the above repository and all I saw as README.md in it. No
> code.​
>

I can't provide the source code because it contains proprietary code but
I've added the binaries as an XMIT file.

David Crayford

unread,
Oct 16, 2017, 10:23:34 PM10/16/17
to
Forgot to mention. The code page is IBM-1047 so square brackets may be
an issue. Don't blame me, blame brain damaged EBCDIC!


On 16/10/2017 9:36 PM, John McKown wrote:
> On Mon, Oct 16, 2017 at 7:04 AM, David Crayford <dcra...@gmail.com> wrote:
>
>> I wrote a TSO REXX regex command processor years ago
>> https://github.com/daveyc/RTK. It supports ECMAScript regex syntax
>> (C++11) which is close to PCRE but not identical. It's fast too as it
>> doesn't have the function call overhead of establishing an LE
>> environment on every call like other APIs. ECMAScript doesn't support
>> POSIX [:digit:] expressions, instead it uses /d which is far less
>> verbose. I posted it on here at the time but nobody was interested which
>> may be due to Bob's issue of having to install it at customer sites but
>> probably due to the lack of interest for regexes for TSO REXX.
>>
>>
> ​David,
>
> I just cloned the above repository and all I saw as README.md in it. No
> code.​
>
>

Paul Gilmartin

unread,
Oct 16, 2017, 10:38:41 PM10/16/17
to
On 2017-10-16, at 20:23:19, David Crayford wrote:

> Forgot to mention. The code page is IBM-1047 so square brackets may be an issue. Don't blame me, blame brain damaged EBCDIC!
>
I do.

-- gil

David Crayford

unread,
Oct 16, 2017, 11:15:43 PM10/16/17
to
On 16/10/2017 8:41 PM, Ze'ev Atlas wrote:
> Does your routine support those POSIX classes?
>

Yes. It supports anything in the grammar rules
http://www.cplusplus.com/reference/regex/ECMAScript/. It's basically a
C++ program that uses the C++ standard library regex classes. It can
support multiple grammars, ECMAScript, awk, basic POSIX, extended POSIX.
Although I hard coded ECMAScript as it's the most powerful. It didn't
envisage anybody wanting to use basic POSIX grammars.

> Obviously your idea has the advantages that you have mentioned and
> PCRE has the disadvantages in those aspects.  The advantage of PCRE is
> being a standard, fully maintained package that is Perl compatible,
> not only EMACS compatible.
>

PCRE is more powerful, it supports recursion. At the time I wrote the
package I hadn't build the PCRE library on z/OS yet. ECMAScript is
pretty close though and is good enough for what I wanted.

> The good news is that now we have choices, your routine and PCRE may
> 'compete'.  Choices are always good we are told.
>

Compete for what market. You can count the number of mainframers willing
to try new stuff on one hand. Show them something as complex as regular
expressions and they will throw it straight into the "too hard" basket.

> BTW, for those who have it installed, IBM supply the 'standard' C
> library with the standard POSIX regex functions.  Somebody may follow
> our lead and code an API for those.  They are POSIX compliant and
> (need some research) may or may not meed LE.  If they do not need LE,
> then replacing your code with a very simple API that everybody can
> copy rather than install may solve the installation problem... and the
> client may not complain about using some non-standard code.
>

My package is a C++ program with assembler "glue" code for the CEEPIPI
bridge. The CEEPIPI bridge is the "secret sauce". I used a PEG based
parser framework from the boost C++ libraries. It's very little code but
it is very quick due to the bridging. The overhead is parsing not in
creating LE environments like a lot of REXX APIs I've seen.

> David, do you want to look into that option or should I?

I'm not planning on spending any time on this. I wrote my package years
ago when I was using REXX. I figured that by using CEEPIPI I could write
"better" APIs than those shipped with TSO. For example, using the C
stdio fopen() and friends I could replace the likes of "EXECIO" with a
package that could handle VSAM and UNIX files and run significantly
quicker. But then I stumbled across Lua and abandoned REXX.

>
> Ze'ev Atlas
>
> Sent from Yahoo Mail on Android
> <https://overview.mail.yahoo.com/mobile/?.src=Android>
>
> On Mon, Oct 16, 2017 at 8:16 AM, David Crayford
> <dcra...@GMAIL.COM> wrote:
> "ECMAScript doesn't support POSIX [:digit:] expressions"
>
>     Actually that's not true it does
> http://www.cplusplus.com/reference/regex/ECMAScript/#character_classes.
>
>
> On 16/10/2017 8:04 PM, David Crayford wrote:
> > I wrote a TSO REXX regex command processor years ago
> > https://github.com/daveyc/RTK.
> <https://github.com/daveyc/RTK.%20>It supports ECMAScript regex
> syntax
> > (C++11) which is close to PCRE but not identical. It's fast too
> as it
> > doesn't have the function call overhead of establishing an LE
> > environment on every call like other APIs. ECMAScript doesn't
> support
> > POSIX [:digit:] expressions, instead it uses /d which is far less
> > verbose. I posted it on here at the time but nobody was interested
> > which may be due to Bob's issue of having to install it at customer
> > sites but probably due to the lack of interest for regexes for
> TSO REXX.
> >
> >
> > On 13/10/2017 11:26 PM, Bob Bridges wrote:
> >> I used to venture gingerly into regular expressions, say once a
> year
> >> at most, when writing routines in VBA.  But a couple of years
> ago I
> >> spent a tumultuous 18 months writing Excel spreadsheets for a bank
> >> RBAC project, and finally learned to employ them routinely. 
> I'd be
> >> delighted to have the same thing in TSO-REXX. But I'm a
> contractor,
> >> flitting from client to client, so I'm unlikely to have access to
> >> such a package until it's part of the standard language.
> >>
> >> ooREXX has regular expressions?  That's one more reason for me to
> >> download it.  Maybe it'll tip the balance.
> >>
> >> ---
> >> Bob Bridges, cell 336 382-7313
> >> robhb...@gmail.com <mailto:robhb...@gmail.com>
> >> rbri...@InfoSecInc.com <mailto:rbri...@InfoSecInc.com>
> ----------------------------------------------------------------------
> >> For TSO-REXX subscribe / signoff / archive access instructions,
> >> send email to LIST...@VM.MARIST.EDU
> <mailto:LIST...@VM.MARIST.EDU> with the message: INFO TSO-REXX
> >
>
> ----------------------------------------------------------------------
> For TSO-REXX subscribe / signoff / archive access instructions,
> send email to LIST...@VM.MARIST.EDU
> <mailto:LIST...@VM.MARIST.EDU> with the message: INFO TSO-REXX

John McKown

unread,
Oct 17, 2017, 8:13:40 AM10/17/17
to
On Mon, Oct 16, 2017 at 9:16 PM, David Crayford <dcra...@gmail.com> wrote:

> On 16/10/2017 9:36 PM, John McKown wrote:
>
>> On Mon, Oct 16, 2017 at 7:04 AM, David Crayford <dcra...@gmail.com>
>> wrote:
>>
>> ​David,
>>
>> I just cloned the above repository and all I saw as README.md in it. No
>> code.​
>>
>>
> I can't provide the source code because it contains proprietary code but
> I've added the binaries as an XMIT file.
>
>
​Got it. Thanks.

--
I just child proofed my house.
But the kids still manage to get in.


Maranatha! <><
John McKown

0 new messages