It was given as an example from here https://www.regular-expressions.info/ip.html.
So I wrote this little macro with the regex Cut&Pasted as...(this is running in Sweden so under CP278).
/*MACRO*/ TRACE "C"
ADDRESS ISREDIT
"MACRO (DUMMY) NOPROCESS"
reg = ,
"\b(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.",
!!"(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.",
!!"(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.",
!!"(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\b"
"X ALL"
"F RC'"!!reg!!"' ALL "
EXIT 1
ADDRESS ISREDIT
"MACRO (DUMMY) NOPROCESS"
reg = ,
"\b(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.",
!!"(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.",
!!"(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.",
!!"(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\b"
"X ALL"
"F RC'"!!reg!!"' ALL "
EXIT 1
3 *-* "MACRO (DUMMY) NOPROCESS"
>>> "MACRO (DUMMY) NOPROCESS"
9 *-* "X ALL"
>>> "X ALL"
10 *-* "F RC'"!!reg!!"' ALL "
>>> "F RC':b(25:0-5::2:0-4::0-9::1:0-9::0-9:::1-9:?:0-9:):.(25:0-5::2:
0-4::0-9::1:0-9::0-9:::1-9:?:0-9:):.(25:0-5::2:0-4::0-9::1:0-9::0-9:::1-9:?:0-9
:):.(25:0-5::2:0-4::0-9::1:0-9::0-9:::1-9:?:0-9:):b' ALL "
+++ RC(4) +++
***
>>> "MACRO (DUMMY) NOPROCESS"
9 *-* "X ALL"
>>> "X ALL"
10 *-* "F RC'"!!reg!!"' ALL "
>>> "F RC':b(25:0-5::2:0-4::0-9::1:0-9::0-9:::1-9:?:0-9:):.(25:0-5::2:
0-4::0-9::1:0-9::0-9:::1-9:?:0-9:):.(25:0-5::2:0-4::0-9::1:0-9::0-9:::1-9:?:0-9
:):.(25:0-5::2:0-4::0-9::1:0-9::0-9:::1-9:?:0-9:):b' ALL "
+++ RC(4) +++
***
I wondered if it might be a conversion problem so I switched to CP037 and retried, re-pasting the regex from that site as…
/*MACRO*/ TRACE "C"
ADDRESS ISREDIT
"MACRO (DUMMY) NOPROCESS"
reg = ,
"\b(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.",
||"(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.",
||"(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.",
||"(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\b"
"X ALL"
"F RC'"reg"' ALL "
EXIT 1
ADDRESS ISREDIT
"MACRO (DUMMY) NOPROCESS"
reg = ,
"\b(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.",
||"(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.",
||"(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.",
||"(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\b"
"X ALL"
"F RC'"reg"' ALL "
EXIT 1
3 *-* "MACRO (DUMMY) NOPROCESS"
>>> "MACRO (DUMMY) NOPROCESS"
9 *-* "X ALL"
>>> "X ALL"
10 *-* "F RC'"reg"' ALL "
>>> "F RC':b(25:0-5:|2:0-4::0-9:|1:0-9::0-9:|:1-9:?:0-9:):.(25:0-5:|2:
0-4::0-9:|1:0-9::0-9:|:1-9:?:0-9:):.(25:0-5:|2:0-4::0-9:|1:0-9::0-9:|:1-9:?:0-9
:):.(25:0-5:|2:0-4::0-9:|1:0-9::0-9:|:1-9:?:0-9:):b' ALL "
***
>>> "MACRO (DUMMY) NOPROCESS"
9 *-* "X ALL"
>>> "X ALL"
10 *-* "F RC'"reg"' ALL "
>>> "F RC':b(25:0-5:|2:0-4::0-9:|1:0-9::0-9:|:1-9:?:0-9:):.(25:0-5:|2:
0-4::0-9:|1:0-9::0-9:|:1-9:?:0-9:):.(25:0-5:|2:0-4::0-9:|1:0-9::0-9:|:1-9:?:0-9
:):.(25:0-5:|2:0-4::0-9:|1:0-9::0-9:|:1-9:?:0-9:):b' ALL "
***
ISPF Edit Macro Error
Command ===>
******************************************************************************
* *
* Command in error . : F RC'\b(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\ *
* *
* Invalid reg expression *
* The regular expression failed to compile. *
* *
* Error message ID . : ISRE997 *
* *
* Last return code . : 12 *
* *
* Macro executing . : MYMACRO *
* *
* Press ENTER key to terminate the macro. *
* *
* *
* *
******************************************************************************
Command ===>
******************************************************************************
* *
* Command in error . : F RC'\b(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\ *
* *
* Invalid reg expression *
* The regular expression failed to compile. *
* *
* Error message ID . : ISRE997 *
* *
* Last return code . : 12 *
* *
* Macro executing . : MYMACRO *
* *
* Press ENTER key to terminate the macro. *
* *
* *
* *
******************************************************************************
+++ RC(28) +++
***
***
Switching back to CP278…
This simpler example from the same site also doesn’t work…
EDIT N472730.USER.JCL(Q) - 01.00 Columns 00001 00072
Command ===> f RC'\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b' Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 222.99.3.0
****** **************************** Bottom of Data ****************************
Command ===> f RC'\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b' Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 222.99.3.0
****** **************************** Bottom of Data ****************************
ZOS390RL = z/OS 02.02.00
ZISPFOS = ISPF FOR z/OS 02.02.00
ZENVIR = ISPF 7.2 MVS TSO
ZISPFOS = ISPF FOR z/OS 02.02.00
ZENVIR = ISPF 7.2 MVS TSO
However…
From the IBM manual (SC19-3621-30) I can get this simple example that works as stated and finds MEAN,MAIN,MEIN (but not MAN)…
EDIT N472730.USER.JCL(Q) - 01.00 Columns 00001 00072
Command ===> f R'm[eaiy]{2}n' all Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 MEAN
000002 MAIN
000003 MIEN
000004 MAN
****** **************************** Bottom of Data ****************************
Command ===> f R'm[eaiy]{2}n' all Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 MEAN
000002 MAIN
000003 MIEN
000004 MAN
****** **************************** Bottom of Data ****************************
3 CHARS 'm[eaiy]{2}n'
ISRE105 CHARS 'm[eaiy]{2}n' - found 3 times within columns 1 to 80
ISRE105 CHARS 'm[eaiy]{2}n' - found 3 times within columns 1 to 80
Any ideas what I apparently have wrong with my regex? I'm a real newbie on these!
Thanks in advance