PCRE for z/OS
PCRE2 plans
About C and Patches
Important Points

As a complementary to the PCRE library, I've adapted the standard IBM regex.h header file to COBOL, to allow usage of the standard IBM C Run-Time library functions from within COBOL.  By using these copybooks and the standard IBM C Run-time library (that is available in all z/OS machines as far as I can tell), one may do pattern matching using Regular Expression from COBOL.  I am not the first or only person who uses this capability.  My contribution is by providing standard copybooks and explaining how to use the 'Capture' capability in addition to the common 'Match' capability.  The reason for this work is that the only serious argument I've ever heard for not using my port of the PCRE library was that "management would never allow use of Open Source". One can freely take my copybooks that only describe structures and use them with the bona-fide IBM supplied functions. Please feel free to copy the definition only and avoid the "open Source" mambo Jumbo if you do not intend to distribute your poor COBOL program!
One has now a comon interface to these functions:

regcomp() — Compile regular expression

regerror() — Return error message

regexec() — Execute compiled regular expression

regfree() — Free memory for regular expression