Skip to main content

i'm using 10.0.1 runtime on windows platform and basic pattern matching seems to work fine but if I try something that uses the logical OR operator (|) it fails to match. 

For example, this expression works (matches on "test 2, test1"): 

test2.*test1

This one doesn't find any matches (should at least match the above example): 

test1|test2

My runtime-exp-flg is set to 1 to ignore case which works on the first example.  I have also tried 0, 3,5, 11. I realize part of the challenge is my regex skills but if anyone has good example of it working or suggestions, I would appreciate it.

 


#extend
#AcuCobol

i'm using 10.0.1 runtime on windows platform and basic pattern matching seems to work fine but if I try something that uses the logical OR operator (|) it fails to match. 

For example, this expression works (matches on "test 2, test1"): 

test2.*test1

This one doesn't find any matches (should at least match the above example): 

test1|test2

My runtime-exp-flg is set to 1 to ignore case which works on the first example.  I have also tried 0, 3,5, 11. I realize part of the challenge is my regex skills but if anyone has good example of it working or suggestions, I would appreciate it.

 


#extend
#AcuCobol

If you haven't already, you may want to look at the regexp.cbl sample program. Compile it for debug so you can step through the code. Here's a simple test. 

Create a file named regex.txt in the same directory as the sample program and add the following entries in it. 

hello
bye
hi
later

Open a command prompt to the location of the sample program and use the following command line, assuming you have the runtime in your PATH

wrun32 -d regexp.acu "o|i" regex.txt

As you step through the program in debug you should see the output below. 

This is a very simple test, but I hope you find it helpful.