Hello Januk,
Tuesday, April 17, 2001, 1:52:01 AM, you wrote:
JA>
%SETPATTREGEXP="(?i)(?(?=.*?\<list\>.*?;;.*;;.*).*;;(.*);;.*|.*;;.*;;(.*))"%REGEXPBLINDMATCH="%TOLIST%CCLIST%BCCLIST;;%QINCLUDE=""GROUP"";;%QINCLUDE=""INDIV"""%SUBPATT="1"%SUBPATT="2"
I have struggled with the macro semantics of this line. Have I
understood this correctly?
You put all these statments on one line so that the text shall be
output on the top line of the letter. It is possible to split this
into 4 macro statments (the second statement contains 5 macro
statements inside itself):
%SETPATTREGEXP="(?i)(?(?=.*?\<list\>.*?;;.*;;.*).*;;(.*);;.*|.*;;.*;;(.*))"
%REGEXPBLINDMATCH="%TOLIST%CCLIST%BCCLIST;;%QINCLUDE=""GROUP"";;%QINCLUDE=""INDIV"""
%SUBPATT="1"
%SUBPATT="2"
%REGEXPBLINDMATCH collects 3 strings:
%TOLIST%CCLIST%BCCLIST,
%QINCLUDE=""GROUP"",
%QINCLUDE=""INDIV"""
These 3 strings are matched by %SETPATTREGEXP
Inside the conditional paranthese, the first string is checked for the
apperance of <list>, the other two strings can be whatever they want.
Two substrings are set.
If the condition is met, then the last substring is made empty. The
first substring takes all the three strings, eject the first and last
and only keep the middle one marked with paranthese (.*), which
happens to be the Quicktemplate with handle Group.
If the condition is not met, the first substring is made empty. The
last substring collects all three strings but ejects the first and
second and only keep the third marked with paranthese (.*) which
happens to be the Quicktemplate with handle Indiv.
%SUBPATT="1"%SUBPATT="2" prints both substrings, but since one of them
is empty, we only see the %SUBPATT that actually contains text.
But I still do not quite get these .* and (.*). In the help file
it is said that * matches zero or more instances of the atom.
How is it that .* returns nothing while (.*) returns the
whole string?
--
Best regards,
Ottar mailto:[EMAIL PROTECTED]
--
______________________________________________________
Archives : <http://tbtech.thebat.dutaint.com>
Moderators : <mailto:[EMAIL PROTECTED]>
Unsubscribe: <mailto:[EMAIL PROTECTED]>
You are subscribed as : [email protected]