Hello Nick,
Historians believe that Thu, 3 May 2001 at 09:45 GMT -0500 was when,
Nick Danger [ND] typed the following:
<snip>
ND> In using the macro %CCList in a template the result is in a format
ND> such as this -
ND> Cherie Rotas <[EMAIL PROTECTED]>; David Kelly <[EMAIL PROTECTED]>;
ND> There are two things I would like to change about this. First, is
ND> there anyway to reformat the output into a list style as:
ND> Cherie Rotas <[EMAIL PROTECTED]>
ND> David Kelly <[EMAIL PROTECTED]>
ND> Also, most times I don't need the address included, just a name would
ND> do well.
<snip>
I'm not sure if you want both lists, or just one? I'll assume you
just want the name.
In any case, here is the basic repeat unit for the regexp:
<begin repeat unit>
((.*?)\s*(\<.*?\>)?[;,]\s*)?
<end repeat unit>
The part you want is the second set of parentheses. There are three
sets of parentheses per repeat unit, ie, three subpatterns per
name/address in the CCLIST.
ND> As is, if the CC list is rather extensive, as mine can be with
ND> sometimes up to 10-12 names,
Ok, it gets a bit ugly, but just keep in mind what I said above. We
have a single repeat unit repeated 15 times for good measure.
%SETPATTREGEXP="(?i)^((.*?)\s*(\<.*?\>)?[;,]\s*)?((.*?)\s*(\<.*?\>)?[;,]\s*)?((.*?)\s*(\<.*?\>)?[;,]\s*)?((.*?)\s*(\<.*?\>)?[;,]\s*)?((.*?)\s*(\<.*?\>)?[;,]\s*)?((.*?)\s*(\<.*?\>)?[;,]\s*)?((.*?)\s*(\<.*?\>)?[;,]\s*)?((.*?)\s*(\<.*?\>)?[;,]\s*)?((.*?)\s*(\<.*?\>)?[;,]\s*)?((.*?)\s*(\<.*?\>)?[;,]\s*)?((.*?)\s*(\<.*?\>)?[;,]\s*)?((.*?)\s*(\<.*?\>)?[;,]\s*)?((.*?)\s*(\<.*?\>)?[;,]\s*)?((.*?)\s*(\<.*?\>)?[;,]\s*)?((.*?)\s*(\<.*?\>)?([;,]\s*)?)?.*?$"
%REGEXPBLINDMATCH="%CCLIST"
The names alone will be in subpatterns 2, 5, 8, 11, ... 47. (Count
again to make sure I got that top number right.
You can make a list any way you please using:
%SUBPATT="2",
%SUBPATT="5",
...
ND> Does anyone have any ideas on how to accomplish both or either of
ND> these tasks?
Yup, but its ugly.
--
Thanks for writing,
Januk Aggarwal
Using The Bat! 1.52 Beta/14 under Windows 98 4.10 Build 2222 A
Personal Plan: To avoid sanity, lucidity and wit at all costs.
--
______________________________________________________
Archives : <http://tbtech.thebat.dutaint.com>
Moderators : <mailto:[EMAIL PROTECTED]>
Unsubscribe: <mailto:[EMAIL PROTECTED]>
You are subscribed as : [email protected]