Hello Mike,
On Sunday, February 23, 2003 at 4:38 PM, a witness saw Mike Dillinger
[MD] type:
MD> I'd like to remove the leading spaces so they're lined up at column 1,
You need to use a recursive template for that type of processing.
That means you need two templates (you can do it with one, but the
only person I know of who has done it correctly is Carsten). The
first template just sets up the Comments field, then calls the
recursive engine, ie:
=====[Begin DelLS]=====
%Comment="%Text"%-
%Quotes='%QInclude="DelLS2"'%-
%Comment=""
=====[ End DelLS]=====
The recursive engine should look something like:
=====[Begin DelLS2]=====
%REM='
Reformatting routine to remove leading spaces.
DelLS2 = recursive engine QT
Written by Januk Aggarwal
February 2003
'%-
%-
%IF:'%-
%SETPATTREGEXP="(?is-m)[^\n]+"%-
%REGEXPMATCH="%COMMENT"'<>'':'%-
%-
%SETPATTREGEXP="(?is-m)^[^\S\n]*(.*?)(\n((.*\n)*)\z|\z)"%-
%REGEXPMATCH="%COMMENT"
%-
%COMMENT=_%SETPATTREGEXP="(?is-m)^[^\S\n]*(.*?)(\n((.*\n)*)\z|\z)"%-
%-%-%-%-%-%REGEXPBLINDMATCH="%COMMENT"%-
%-%-%-%-%-%SUBPATT="3"_%-
%-
%QINCLUDE="DelLS2"'%-
=====[ End DelLS2]=====
This seems to work here.
--
Thanks for writing,
Januk Aggarwal
________________________________________________________
Current version is 1.61 | "Using TBTECH" information:
http://www.silverstones.com/thebat/TBUDLInfo.html