Notes on porting Henry Spencer's reg to Win32.

Sources

Obtained from http://www.scriptics.com in the Tcl8.2x distribution.

These files were extracted from the generic folder in the Tcl distribution and are archived in the Orig.zip file that accompanies this port.

Porting

My port replaces all Unicode Tcl code with nearest equivalent ANSI-only code. No new files were added. Most changes were made to regcustom.h and regc_local.c.

Testing

To test my port, the Tcl script reg.test was copied to regtest.tcl and modified to output to a file called regtest.c, which a single function test. This function is invoked from the test.cpp file in the test sub-project. The convert.cmd file is a helper that calls the Tcl interpreter. The convert.pl is an aborted attempt at interpreting the Tcl strings from Perl. I realized that Tcl was already much better at that then I could be in Perl, hence the Tcl script.

Not all of the tests are performed (notably Unicode tests, tests which return indices or tests that do partial matching). Of the tests that are performed, not all of them succeed, as shown in this output:

Failed during test #14.2 'back references':
        'mismatched number of sub-strings'

Failed during test #14.17 'back references':
        'mismatched number of sub-strings'

Failed during test #20.2 'directors and embedded options':
        'invalid argument to regex function'

Failed during test #20.4 'directors and embedded options':
        'invalid argument to regex function'

Failed during test #21.23 'capturing':
        'mismatched number of sub-strings'

Failed during test #21.34 'capturing':
        'mismatched number of sub-strings'

Failed during test #25.3 'mixed quantifiers':
        'mismatched number of sub-strings'

Unfortunately, since I can't get Henry's original reg.test Tcl script to run on my machine, I don't know if these tests fail because of his code, my port of his code, my test code or my translation of his test cases. <sigh>

Syntax Documentation

Converted re_syntax.n to re_syntax.htm on a Unix machine:

nroff -man re_syntax.n | man2html > re_syntax.htm

man2html obtained from http://www.oac.uci.edu/indiv/ehood/man2html.html. Make sure to

chmod +x man2html

before running man2html.