Version 1 of A regexp extension

Updated 2005-01-15 13:05:54

NJG January 15, 2005

Recently I posted the page A regexp twist. Not having any feedback I have no idea how much attention it has received. It has, however, suddenly occured to me that neither the title nor the style of the prose were very advertising of its essence. So here is a more direct try.

A regexp twist provides an extensiont to the functionality of the regexp command in the form of

regexp -inline ?other options? pattern string script

where script would be executed each time a pattern match occured. (Note that in current Tcl this is illegal so it represents a compatible extension.) The result of the actual match is available to script in the global match variables mVar0, mVar1, .... mVar9.

For Windows users the downloadable zip file contains the source and the extension dll.

Those on Linux may either replace the .dll specific part of the source with whatever is needed for compiling it into an .so module or replace the function Tcl_RegexpObjCmd in file tclCmdMZ.c of their Tcl source distribution with the one in the provided source and recompile Tcl. Lacking time I cannot help those who need a Linux binary.

Please note: I have no idea which is the oldest Tcl version number for which this extension works. For Tcl 8.4.x it surely does.