Re: Regexp. Should be easy I think..

2004-04-21 Thread Januk Aggarwal
Hello Leif,

On Tuesday, April 20, 2004 at 20:13 GMT -0600, a stampede was started
when Leif Gregory hollered:

It just occurred to me, if you're using PHP, can't you get all the
info you need without using regexps?  I seem to recall that there are
built in functions that can get you pretty much any info you want,
though I can't find it in the phpinfo() function...

 I'm pretty sure the HTTP request type will always be first so I can
 anchor with ^, but IIS likes to put the SERVER before the DATE, and
 Sambar is the reverse. So, my thinking was that if I did the HTTP part
 and then moved up to the first : and backed up to the first
 whitespace, I could grab the next chunk (either DATE or SERVER) up to
 the next : (and then back to the first whitespace), and continue that
 until I hit the EOL.

You can do that with the chunk that I wrote. What I don't know is how
php handles regexps. I know in VBScript, when you do a regexp, all
possible matches are stored in an array, so it is pretty easy to
get out all the parts you want. In TB, that isn't the case, so I tend
to forget about that option. If php will populate an array, then
you're golden. The regexp could be fairly simple.

JA (?i)(Date:\s*.*?)((\s\S+:\s)|\z)
JA But increasing accuracy has the price of decreasing tolerance for
JA errors in the string.

 Exactly.

The way I wrote the above regexp, you should be pretty accurate
without losing any generality.

 I didn't check an Apache server (I'll do that tomorrow) to
 see how it outputs its HTTP headers. I am looking for something
 generic, hence my hoping I could use the : as jump points to back up
 from.

If you really want to do that, you should use a look-ahead assertion.
Something like:
(\S*:\s*.*?)\s(?=\S*:\s)

I haven't tried this in PHP, but in principle it should work.

 Right. That shouldn't be a problem. I have a list of the atoms for PHP
 and they are close to TB.

Excellent.  Do you mind sending me either a link or the list (off list
if you like)?  I was slowly learning some PHP stuff myself, so that
could be very useful.

 I had considered that (just doing multiple reg matches), but wondered
 if there was a better way. It is a very small script, so it wouldn't
 really kill the performance by doing multiple reg matches.

Like I mentioned above, if PHP fills an array with all the matches,
you get the best of both worlds.

 So far, this one has always been first. It'll get ugly if it pops up
 somewhere else on some strange webserver.

Well then, it doesn't have to be hard, just use:
^(.*?)\s+(\S*:\s)

 The order does change with exception to HTTP that I've discovered so
 far anyways.

Well, with multiple regexps, this isn't an issue.  A single TB style
match is more difficult with this restriction.  The only way around it
would be to use If..then statements, but the question becomes: which
is worse?  Running several matches, or processing the matches through
a conditional cascade?

 This might just be the best way to do it.

It certainly is the easiest, though you will probably pay in
performance if every clock cycle counts.

 Yeah, but then I'd have to read at least ten posts telling me to
 Google it. Like I really hadn't thought of that! grin

sigh That's why we need TBPHP, TBEverything_Under_The_Sun.  You'd be
willing to moderate a few more lists, right? ;-)

-- 
Thanks for writing,
 Januk Aggarwal






http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Reply addressing cleanup macro

2004-04-14 Thread Januk Aggarwal
Hello dAniel,

On Wednesday, April 14, 2004 at 18:19 GMT +0200, a witness saw Daniel
Hahler [DH] commit:

DH I'd use a python script for that.
snip

Thanks. That's getting close to what I requested. After thinking about
the intelligent template requirements that I have, I think I'm going
to have to do a recursive template with a lot of customization. I'm
not sure that a general purpose template will work for this one.

Alright, that's a project for some evening when I have time.

DH That's quite powerful.

That does look good.  If only I didn't have to install a program in
addition to the plugin...

DH HTH, I replaced my old CCLIST-killer with this one, too.. :)

That's good, at least you've benefited from this exercise.  :-)

-- 
Thanks for writing,
 Januk Aggarwal





http://www.silverstones.com/thebat/TBUDLInfo.html


Re: MIME(?)-decoding in QT

2004-02-26 Thread Januk Aggarwal
Hello Alexander,

On Thursday, February 26, 2004 at 20:30 GMT +0500, authorities charged
Alexander Leschinsky [AL] for writing:

AL The Bat evaluate all before final state

Really?  Can you give me an example where that happens?  I didn't
think you could dynamically generate templates.  Isn't that something
of a security risk?

-- 
Thanks for writing,
 Januk Aggarwal






http://www.silverstones.com/thebat/TBUDLInfo.html


Re: MIME(?)-decoding in QT

2004-02-25 Thread Januk Aggarwal
Hello Alexander,

On Wednesday, February 25, 2004 at 07:04 GMT +0500, special agents
were informed that Alexander Leschinsky [AL] leaked:

AL As solution can be used trick with creating 128+ macros (one macro for
AL each encoded char), but I'm not _so_ crazy

Why not just escape the %?  %% inserts the character % instead of
evaluating a macro.

-- 
Thanks for writing,
 Januk Aggarwal






http://www.silverstones.com/thebat/TBUDLInfo.html


Re: MIME(?)-decoding in QT

2004-02-25 Thread Januk Aggarwal
Hello dAniel,

Chemists convened on Wednesday, February 25, 2004 at 22:54 GMT +0100
to watch Daniel Hahler [DH] synthesize:

DH You then would have to use sth like PHP's addslashes(), like
DH %addescapes() which would escape all %s in the string you want to
DH decode - but passing that string to the %addescapes()-function would
DH not work either.

Wait, how is this macro supposedly running?  If you're using text from
the clipboard, TB shouldn't evaluate the text.  If the text is coming
from the output of a macro, again TB shouldn't evaluate it.  So unless
you're hard coding the % symbol in your QT, this should be a
non-issue...

-- 
Thanks for writing,
 Januk Aggarwal






http://www.silverstones.com/thebat/TBUDLInfo.html


Re: How to extract the domain part from a mail address

2004-02-05 Thread Januk Aggarwal
Hello Arjan,

Thursday, February 5, 2004 at 23:49 GMT +0100, was when inspiration
required Arjan De Groot to compose:

%SETREGEXPPATT='.*?@(yahoogroups.com)'-
%IF:%REGEXPMATCH='%TO''':%FROM=Arjan de Groot [EMAIL PROTECTED]:%-
%FROM=Arjan de Groot [EMAIL PROTECTED]

 I tried it, but alas, no success. :-(

It would probably work better using variables:

%_Test=%-
%%SETREGEXPPATT='.*?@(yahoogroups.com)'%-
%%REGEXPMATCH='%TO'%-
%IF:'%_Test''':'%FROM=Arjan de Groot [EMAIL PROTECTED]':'%-
%FROM=Arjan de Groot [EMAIL PROTECTED]'

-- 
Thanks for writing,
 Januk Aggarwal





http://www.silverstones.com/thebat/TBUDLInfo.html


Re: How to extract the domain part from a mail address

2004-02-05 Thread Januk Aggarwal
Hello Zygmunt,

On Friday, February 6, 2004 at 00:11 GMT +0100, earthworms were
entertained when Zygmunt Wereszczynski [ZW] exposed:

ZW Simply mistake, it should be %SETPATTREGEXP (this error comes from
ZW copy of dAniel's message).

Yes of course.  I should know better.  Thanks.

-- 
Thanks for writing,
 Januk Aggarwal






http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Anomaly automatically generating my local time zone, when I reply to AOL user's messages

2004-01-09 Thread Januk Aggarwal
Hello Dan,

An archeological dig discovered that on Wednesday, September 3, 2003
at 09:31 GMT -0400, Dan Grunberg [DG] chiseled the following:

DG Many months ago ago, Januk Aggarwal wrote this system of six
DG templates, that generates the time and time-zone tag shown on the
DG first line of my replies. The system of templates automatically
DG corrects the time zone for Standard (S) or Daylight (D) time.

Just to remind everyone, the purpose is to determine Dan's current
timezone  daylight savings setting automatically. Now that TB has
plugin macros, an alternate, and probably much easier solution could
involve a short plugin macro that just reads  returns the info from
the Windows registry (it must be there somewhere).  I haven't yet
attempted to learn how to make plugins, so that's why I sent Dan here.

-- 
Thanks for writing,
 Januk Aggarwal





http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Anomaly automatically generating my local time zone, when I reply to AOL user's messages

2004-01-09 Thread Januk Aggarwal
Hello Terry,

On Friday, January 9, 2004 at 12:49 GMT -0600, dancing erupted as
Terry L Fritts tapped:

 involve a short plugin macro that just reads  returns the info from
 the Windows registry (it must be there somewhere).  I haven't yet
 attempted to learn how to make plugins, so that's why I sent Dan
 here.

 can be obtained from registry - see:
  HKLM\System\CurrentControlSet\Control\TimeZoneInformation

Perfect, thanks.

Dan, you can use the MyMacros plugin, http://en.barin.com.ua/soft/mymacros/.
Specifically, the %RegRead macro would seem to be your best bet.  You
can get the ActiveTimeBias registry entry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias

That should give you the offset in minutes.  From there, you can use a
simple %IF statement to convert it into either the standard time or
daylight time acronym.

It'll be much easier than the complicated mess of templates we had
before.

-- 
Thanks for writing,
 Januk Aggarwal





http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Re[2]: my special filter isn't working all the time

2003-12-03 Thread Januk Aggarwal
Hello Terry,

On Wed, 3 Dec 2003 16:40:14 +, Terry wrote

 Thanks, but this wasn't my filter problem.  I was responding to the
 original post.  I believe the problem was Charlie's.

I wasn't clear, I was responding to Charlie, but I was expanding on your point.

-- 
Thanks for writting,
Januk Aggarwal






http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Web Visibility

2003-12-01 Thread Januk Aggarwal
Hello Mrten,

On Monday, December 1, 2003 at 23:49 GMT +0100, crowds cheered as
Mrten unveiled:

 and remember to use that every time you mail here :)

 (folder templates, anyone? *evil grin*)

Address book templates anyone?  *anti-evil grin*

-- 
Thanks for writing,
 Januk Aggarwal





http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Week of the year

2003-11-20 Thread Januk Aggarwal
Hello Mark,

On Thursday, November 20, 2003 at 20:28 GMT +0100, Mark Partous
pressed random keys until the following was produced:

 Or must (if possible) this be done with RegEx?

As far as I understand it, the plugins can do everything and much more
than a RegExp can.  From the sounds of it, you already have a template
but are looking to simplify it.  Is that correct?

-- 
Thanks for writing,
 Januk Aggarwal




http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Text parsing: RegEx, filters, maybe third party software?

2003-11-11 Thread Januk Aggarwal
Hello Peter,

On Tuesday, November 11, 2003 at 22:22 GMT +0100, authorities charged
Peter Fjelsten [PF] for writing:

PF I works better now.

I'm glad you're working better, but what about the regexps?! ;-)
(Sorry, I tried to resist, really...)

PF I'm in greater trouble concerning the FRAGTMOMSFRI or
PF FRAGTMOMSPLIGTIGT. This string is also empty.

Hmm, this isn't good.  I don't see the error.  Can you please give me
again the exact strings that *could* be in the message?  Maybe I'm
looking for a space that doesn't exist or something...

PF I have wrapped this for readability reasons:

We can use the PCRE extended mode if you really want to make it much
more readable.  You have to be careful where you place the
closing quotes if you use comments.  Also, remember that in extended
mode, whitespace in the expression is ignored.  For example, the
regexp you quoted could be written:

%SetPattRegexp=(?imx-s)
^(Billing\sAddress|Fakturaadresse)[^\n]*?\n   # Billing address label
-{50,}\s*?\n  # Separator line
(.*?)\s*?\n   # Name
((.*?)\s*?\n)?# Address line 1 (optional)
((.*?)\s*?\n)?# Address line 2 (optional)
((.*?)\s*?\n)?# Address line 3 (optional)
((\D{1,2}.\d{3,6})|\d{3,6})\s # Postal Code
(.*?)\s*\n# City
\s*(.*?)\s*?\n# Country


PF This last line is for the post code, right?

I imagine it is much more obvious with the expression above...

PF I guess the missing string stems from the problem with spaces in
PF the possibilities, right?

Yes, probably.  Hmm, ok well you can try replacing the postal code and
city lines above with:

((\D{1,2}-)?\d{2,4}(\s\d{2,3}))\s # Postal Code
\s*?(\D.*)\s*?\n  # City

The subpattern of the City and Country both increase by 1, ie they are
in subpatterns 12 and 13 respectively.

J %RegexpBlindMatch=%Text%-

PF What does this line do? Does it say where to extract the result from?

Yes, and it runs the expression so the subpatterns get filled with
their results.  Because we did a blind match, nothing is returned
unless we explicitly call a %Subpatt macro.

PF This is wrong. Although the string DK moms/VAT: is present the pure
PF number is returned and it is set to FRAGTMOMSFRI (without *0,8)

Ok, obviously the %IF condition isn't being met.  The following regexp
should return the DK moms/VAT string if it is present:
%RegexpText=(?im-s)^Total:.*\n\s*?(Moms|DK\smoms\/VAT)\n\n

That's what we're using to make the choice of output.  Maybe we should
add a \s* (without quotes) immediately before the closing \n\n pair.

J Subpatterns are simply parts of the regexp surrounded by round
J brackets.  Counting them is also very easy, just count the number of
J opening brackets.

PF ... and they are numbered sequentially?

Yes.

PF Any hint as to recursive element for the goods which are each instance
PF is preceded by varer?

The basic template for a recursive template is something like:

=[Begin generalized recursive template]=
%REM='
   TB v2.0x recursive template template
   Written November 2003 by Januk Aggarwal
'%-
%-
%REM='
   This is an initialization segment.  It can be removed if you
   know that you'll initialize the text variable outside of this
   QT
'%-
%IF:'%_QTName_FirstTime'='':'%-
%___%IF:%_QTName_Text=:%_QTName_Text(%Clipboard)%-
%___%_QTName_FirstTime=No'%-
%-
%-
%REM='
   This is the main processing segment
'%-
%-
%REM=' Remaining text condition '%-
%IF:'%-
%SetPattRegexp=(?is-m)[^\n]+%-
%RegexpMatch(%_QTName_Text)''':'%-
%-
%REM=  Main regexp.  You can pull out all interesting sections of
text here.  Just do it line by line/repetition by repetition
%-
%-
%SetPattRegexp=(?is-m)^(.*?)\n(.*)$%-
%RegexpBlindMatch(%_QTName_Text)%-
%-
%REM=  Put the subpatterns into useful variables  %-
%-
%_QTName_Line_1(%Subpatt(1))%-
%_QTName_Remainder_Of_Text(%Subpatt(2))%-
%-
%REM=  Do formatting and output here  %-
Some initial text%-
%_QTName_Line_1%-
some closing text
%-
%Rem=  Put remaining text into text variable %-
%-
%_QTName_Text(%_QTName_Remainder_of_Text)%-
%-
%REM=  Call template recursively and then close if 
%QInclude(QTName)'%-
=[ End  generalized recursive template]=

Look at my TB v2 wrap template* for an example.  Or look at the
recipient list template* for an example.  Both are more complicated
than what you need.

Your main regexp would probably something like:
%SetPattRegexp=(?isx-m) # Option setting- Subpattern
^\s*(\d+)\s* # Quantity  -   1
x\s* # Times
(.*?)\s* # Item description  -   2
\((.*?)\)\s* # Item model name   -   3
=\s

Insertion and Deletion shortcuts

2003-11-10 Thread Januk Aggarwal
Hi,

I find myself finally wanting to change the shortcuts for the
insertion and deletion commands.  I haven't found them (though
apparently my vision isn't what it once was) in the shortcut editor.
Does anyone know if it can be done and how?  Ideally I would just add
my shortcuts to the current possibilities.  The reasons should be
obvious from the list below.

In case anyone is wondering, I basically want some EMACS/Pico
shortcuts:

Command Current Shortcut  Mine
Delete to the end of line   Ctrl+Q Y  Ctrl-K
Delete character to the leftBackspace Ctrl-H
Delete character to the right   Del   Ctrl-D
To the start of the row Home  Ctrl-A
To the end of the row   End   Ctrl-E

SOT: Actually, these shortcuts would be useful enough to me in other
 programs too that I'd almost be willing to install a third party
 program if it could do the job.  Does anyone know of such a
 program? 

-- 
Thanks,
 Januk Aggarwal

Using The Bat! 2.01.26 under Windows XP 5.1 Build 2600 Service Pack 1






http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Text parsing: RegEx, filters, maybe third party software?

2003-11-09 Thread Januk Aggarwal
Hello Peter,

On Thursday, November 6, 2003 at 23:26 GMT +0100, something compelled
Peter Fjelsten [PF] to inscribe:

PF It's the strangest thing: for some orders, it works 85% on for others
PF only 10% - although there are more that works 10% than 85%.

That's because the address regexps can't handle the colon after the
labels in the second example.  There are a couple of other errors too.
Try the following (note: I haven't tested this much, so it may need
polishing):

=[Begin template fragment]=
%Rem= Get Name and address from Billing Address %-
%-
%SetPattRegexp=(?im-s)^(Billing\sAddress|Fakturaadresse)[^\n]*?\n-{50,}\s*?\n(.*?)\s*?\n((.*?)\s*?\n)?((.*?)\s*?\n)?((.*?)\s*?\n)?((\D{1,2}.\d{3,6})|\d{3,6})\s(.*?)\s*\n\s*(.*?)\s*?\n
%RegexpBlindMatch=%Text%-
NAVN=%SubPatt(2)

ADRESSE1=%SubPatt(4)

ADRESSE2=%SubPatt(6)

ADRESSE3=%SubPatt(8)

POSTNR=%SubPatt(10)

BYNAVN=%SubPatt(11)

LAND=%SubPatt(12)

%Rem= Get Name and address from Delivery Address %-
%-
%SetPattRegexp=(?im-s)^(Delivery\sAddress|Leveringsadresse)[^\n]*?\n-{50,}\s*?\n(.*?)\s*?\n((.*?)\s*?\n)?((.*?)\s*?\n)?((.*?)\s*?\n)?((\D{1,2}.\d{3,6})|\d{3,6})\s(.*?)\s*\n\s*(.*?)\s*?\n
%RegexpBlindMatch=%Text%-
LEV:NAVN=%SubPatt(2)

LEV:ADRESSE1=%SubPatt(4)

LEV:ADRESSE2=%SubPatt(6)

LEV:ADRESSE3=%SubPatt(8)

LEV:POSTNR=%SubPatt(10)

LEV:BYNAVN=%SubPatt(11)

LEV:LAND=%SubPatt(12)

MOMSBEREGNING=DK

VEDR0REND=%SetPattRegexp=(?ism)^(Date\sOrdered|Ordre\smodtaget)[^\n]*\n\s*(.*?)\s*\n(Products|Produkter):%-
%_%RegexpBlindMatch=%Text%-
%_%SubPatt(2)

LEVERING=%RegexpText=(?im-s)^Sub-?total[^\n]*?\n\s*?(.*)\s\(.*?\n

BETALINGSMETODE=For

%_Shipping='%SetPattRegexp=(?im-s)shipping.*?(\d*([\.\,]d*)?)dkk\s*\n%-
%___%RegexpMatch=%Text'%-
%-
%If:'%RegexpText=(?im-s)^Total:.*\n\s*?(Moms|DK\smoms\/VAT)\n\n''':'%-
FRAGTMOMSPLIGTIGT=%Calc=%_Shipping*0.8dkk':'%-
FRAGTMOMSFRI=%_Shipping'
=[ End  template fragment]=

PF As I don't really understand how you make sub-patterns and variables
PF it's a bit hard for me to change your code.

Subpatterns are simply parts of the regexp surrounded by round
brackets.  Counting them is also very easy, just count the number of
opening brackets.  Sometimes subpatterns are created so you can apply
a repeat operator (*,+,{x,y},?) to a string rather than a character.
Sometimes brackets and therefore the subpatterns are designed *only*
to capture a specific part of the string, but they play no role in the
actual matching.  There are more uses, but those two are the main
ones.

Variables are also not too bad.  Any macro that starts with %_ is a
variable.  You don't have to declare a new variable, so you can just
start using them.  Just remember that they have global scope, so if
you have complex, nested templates, you need to give them unique names
unless you want to share data between templates.

PF You use completely different (and probably much better) RegExp
PF then me but it's at a different level then me which makes it hard
PF to understand.

I actually used a fair bit of what you wrote, just combined it and
cleaned some of it up a bit.  But you had done quite a bit of the
logic.  So hang in there, look for things that look similar to yours
and go from there.

-- 
Thanks for writing,
 Januk Aggarwal




http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Bypass Reply Template?

2003-11-09 Thread Januk Aggarwal
Hello Mike,

On Sunday, November 9, 2003 at 9:28 PM, Mike Dillinger pressed random
keys until the following was produced:

 I would occasionally like to bypass my reply templates when I'm reply to
 a message and just have it quote the text with no other template
 processing.  Is this possible?

I can't think of an easy way to do exactly what you want in general*,
but your best bet is probably to create a QT with a simple name
containing:

%CLEAR
%QUOTES

Then run that QT when you reply to these messages.

* If these special replies are always to specific addresses, have you
  looked at AB templates, either individual ones or group ones?

-- 
Thanks for writing,
 Januk Aggarwal






http://www.silverstones.com/thebat/TBUDLInfo.html


Re: V2 Adaption for Remove Leading Spaces?

2003-11-02 Thread Januk Aggarwal
Hello Thomas,

On Sunday, November 2, 2003 at 21:13 GMT +0100, authorities charged
Thomas Woelk [TW] for writing:

TW I checked line for line - my lines are identical with yours.

Hmm...it should work.

TW SB! is freezing and say good bye. Maybe it is a SecureBat!
TW Problem... or whatever. :-(

Marck uses SecureBat too, so more likely there is some minor typo in
your copy.  Can you please post *exactly* what you have in your DelLS2
template?  If you don't know how, go into the template, put the cursor
in the template and press CTRL-A followed by CTRL-C.  Then in the
message editor, use CTRL-V to paste in the template.

-- 
Thanks for writing,
 Januk Aggarwal




http://www.silverstones.com/thebat/TBUDLInfo.html


Re: V2 Adaption for Remove Leading Spaces?

2003-11-02 Thread Januk Aggarwal
Hello Thomas,

It was foretold that on Sunday, November 2, 2003 at 22:37 GMT +0100,
Thomas Woelk [TW] would type:

TW SB! is freezing and say good bye. Maybe it is a SecureBat!
TW Problem... or whatever. :-(

 Can you please post *exactly* what you have in your DelLS2 template?
snip template

Hmm, I tried this and I'm getting it to remove the leading space from
the first line only.  So good news, it shouldn't be crashing.  Bad
news, it still doesn't work.

TW I used the DelLS with my Quotes-Cleaner Quotes_DELLS and it
TW works fine with SB! V1.6.

I have a sneaking suspicion that there is a bug in the regexp
implementation in v2.  I've noticed some weird greedy/non-greedy
interactions*, and I suspect the same thing is happening here.  I'm
very confused why SB and TB would manifest such a bug in different
ways.

I'll try re-writing the template for V2 at some point.  I just have to
find time to squeeze it into my schedule.

* For anyone who is interested, the bug seems to occur when you have a
  greedy modifier between two ungreedy modifiers.  If the strings
  being matched can overlap, then the last modifier wins, not the
  greedy modifier.  For example, suppose I have the string:
  xxxyyyzzz123123123xxxyyyzzz
  And the regexp: ^(.*)(\d*?)(.*)$
  Or: ^(.*?)(\d*)(.*?)$

  In the first case, the entire string is where it should be, in
  subpattern 1.  In the second case, logic suggests that the
  *preferred* match is with xxxyyyzzz in subpatterns 1 and 3 and
  123123123 in subpattern 2.  But what you get if you run it is that
  the entire string ends up in subpattern 3.  This isn't technically
  wrong, but it isn't the optimum match.

-- 
Thanks for writing,
 Januk Aggarwal





http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Text parsing: RegEx, filters, maybe third party software?

2003-11-02 Thread Januk Aggarwal
Hello Peter,

On Thursday, October 30, 2003 at 15:33 GMT +0100, clairvoyants were
mystified when Peter Fjelsten [PF] conjured:

PF  Please bear with me, as this may be a log message and a bit difficult
PF  to understand.

Ok, I've got most of it, though perhaps not the hardest parts.  This
is partially tested, but you'll have to see if it actually works.

=[Begin template fragment]=
%Rem= Get Name and address from Billing Address %-
%-
%SetPattRegexp=(?im-s)^(Billing\sAddress|Fakturaadresse)\s*?\n-{50,}\s*?\n(.*?)\s*?\n((.*?)\s*?\n)?((.*?)\s*?\n)?((.*?)\s*?\n)?((\D{1,2}.\d{3,6})|\d{3,6})\s(.*?)\s*\n\s*(.*?)\s*?\n
%RegexpBlindMatch=%Text%-
NAVN=%SubPatt(2)

ADRESSE1=%SubPatt(4)

ADRESSE2=%SubPatt(6)

ADRESSE3=%SubPatt(8)

POSTNR=%SubPatt(10)

BYNAVN=%SubPatt(11)

LAND=%SubPatt(12)

%Rem= Get Name and address from Delivery Address %-
%-
%SetPattRegexp=(?im-s)^(Delivery\sAddress|Leveringsadresse)\s*?\n-{50,}\s*?\n(.*?)\s*?\n((.*?)\s*?\n)?((.*?)\s*?\n)?((.*?)\s*?\n)?((\D{1,2}.\d{3,6})|\d{3,6})\s(.*?)\s*\n\s*(.*?)\s*?\n
%RegexpBlindMatch=%Text%-
LEV:NAVN=%SubPatt(2)

LEV:ADRESSE1=%SubPatt(4)

LEV:ADRESSE2=%SubPatt(6)

LEV:ADRESSE3=%SubPatt(8)

LEV:POSTNR=%SubPatt(10)

LEV:BYNAVN=%SubPatt(11)

LEV:LAND=%SubPatt(12)

MOMSBEREGNING=DK

VEDR0REND=%SetPattRegexp=(?ism)^(Date Ordered|Ordre 
modtaget):[^\n]*\n\s*(.*?)\s*\n(Products|Produkter):%-
%_%RegexpBlindMatch=%Text%-
%_%SubPatt(2)

LEVERING=%RegexpText=(?im-s)^Sub-?total:.*?\n\s*?(.*)\s*?\n

BETALINGSMETODE=For

%_Shipping='%SetPattRegexp=(?im-s)shipping.*?(\d*([\.\,]d*)?)dkk\s*\n%-
%___%RegexpMatch=%Text'%-
%-
%If:'%SetPattRegexp=(?im-s)^Total:.*\n\s*?(Moms|DK\smoms/VAT)\n\n''':'%-
FRAGTMOMSPLIGTIGT=%Calc=%_Shipping*0.8dkk':'%-
FRAGTMOMSFRI=%_Shipping'
=[ End  template fragment]=


-- 
Thanks for writing,
 Januk Aggarwal





http://www.silverstones.com/thebat/TBUDLInfo.html


Re: V2 Macro Library

2003-10-29 Thread Januk Aggarwal
Hello Alexander,

On Wednesday, October 29, 2003 at 12:23 GMT +0500, clairvoyants were
mystified when Alexander Leschinsky [AL] conjured:

JA I actually meant that the date in the different languages could be
JA made in plugin macros.
AL Something like %DATE=(ddd,German) will produce Sonntag?
AL Hard in implementation - I must have all language-pairs
AL (dd,name,German) is NOT obvious :-(, but I'm open for hints and
AL ideas

That's what I was thinking, though now that you mention it, it doesn't
sound like it will scale very well.  But what about something like
%Date_German=ddd? That way the scope of the problem would be more
limited...

-- 
Thanks for writing,
 Januk Aggarwal




http://www.silverstones.com/thebat/TBUDLInfo.html


Re: V2 Macro Library

2003-10-28 Thread Januk Aggarwal
Hello Alexander,

On Wednesday, October 29, 2003 at 07:41 GMT +0500, Alexander
Leschinsky [AL] pressed random keys until the following was produced:

JA If that's the case, then maybe someone could write a plugin macro
JA to do the job.

AL But who will write dictionary... Plugin is rather easy part of job

I actually meant that the date in the different languages could be
made in plugin macros.  Of course it is just as easy to do a QT that
does the same job.  There should still be at least one example in the
Macro repository.

-- 
Thanks for writing,
 Januk Aggarwal







http://www.silverstones.com/thebat/TBUDLInfo.html


Re: replying as per the TO: address

2003-10-23 Thread Januk Aggarwal
Hello Shantanu,

On Thu, 23 Oct 2003 11:39:49 +0530, Shantanu wrote

 Is there any way to comment a macro in the templates?

%REM is the comment macro.  Be a little careful with which character you use to 
delimit the commented text.  Any instances of that character in the text itself 
must be doubled.  ie:
%REM='%QInclude=''Some QT'''
would comment out the %QInclude='Some QT' statement.  However:
%REM=%QInclude=Some QT would give output:
Some QT

Alternatively, you can just use different characters all together:
%REM=#%QInclude=Some QT#

-- 
Hope that helps,
Januk



http://www.silverstones.com/thebat/TBUDLInfo.html


Re: changing the 'from' account for a email i'm about to send?

2003-10-21 Thread Januk Aggarwal
Hello Carsten,

On Tuesday, October 21, 2003 at 18:52 GMT +0200, Carsten Thönges heard
voices say:

 %_COMMENT=_%SETPATTREGEXP=(?is-m)^(((\w{0,5}?(\\s*)+)?)(.*?)\n(.*)$|\z)%-
 ^_
 %-%-%-%-%-%REGEXPBLINDMATCH=%_COMMENT%-
 ^ isn't this one interpreted as a
   closing bracket?

sigh Yeah, probably.  One time I forget to add the untested
disclaimer and of course I miss a subtle thing...dangit.  So this
seems to work:

=[Begin requote2 QT]=
%REM='
  Quote reformatting routine to remove prefixes from quotes.
  requote2 = recursive engine QT
  
  Written by Januk Aggarwal
  June 2002
  Updated for TB v2: October 2003
'%-
%-
%IF:'%-
%SETPATTREGEXP=(?is-m)[^\n]+%-
%REGEXPMATCH=%_COMMENT''':'%-
%-
%SETPATTREGEXP=(?is-m)^(((\w{0,5}?((\\s*)+))?)(.*?\n)|\z)%-
%REGEXPBLINDMATCH=%_COMMENT%-
%REM=_%SUBPATT=4_%-
%SUBPATT=6%-
%-
%_COMMENT=#%SETPATTREGEXP=(?is-m)^(((\w{0,5}?(\\s*)+)?)(.*?)\n(.*)$|\z)%-
%-%-%-%-%-%REGEXPBLINDMATCH=%_COMMENT%-
%-%-%-%-%-%SUBPATT=6#%-
%-
%QINCLUDE=requote2'%-
=[ End  requote2 QT]=



-- 
Thanks for writing,
 Januk Aggarwal







http://www.silverstones.com/thebat/TBUDLInfo.html


Re: changing the 'from' account for a email i'm about to send?

2003-10-20 Thread Januk Aggarwal
Hello John,

It was foretold that on Monday, October 20, 2003 at 14:19 GMT -0500,
John Morse would type:

JA Column is useful if you want to cleanup the quote prefixes on a block
JA of text. You can do all the lines at once. It is also useful if you

 What do you mean by this?
 Can you give an example?
 thanks

It's a bit hard to demonstrate without you trying it yourself.
Probably the fastest way for you to see what it can do is to start a
reply to this message.  Then switch to Column mode, either by the
status bar or using Leif's tip (great tip BTW).  Now highlight one of
the JA prefixes in my quote above, then drag down.  You will see a
rectangle of text selected, just the JA prefixes should be selected.
Now you can delete, insert, or whatever, just like you can with normal
highlighting.

You have to be a bit careful when pasting just because it doesn't
behave exactly the way normal stream mode does.  That's a very good
thing at times, but you need to get used to the difference.


-- 
Thanks for writing,
 Januk Aggarwal







http://www.silverstones.com/thebat/TBUDLInfo.html


Re: changing the 'from' account for a email i'm about to send?

2003-10-20 Thread Januk Aggarwal
Hello Mark,

On Monday, October 20, 2003 at 10:45 AM, clairvoyants were mystified
when Mark Wieder [MW] conjured:

MW !!! That's great !!! I've always wanted an easy way to do that. I've
MW been resorting to redirecting emails instead of forwarding them when
MW I've needed to eliminate the JA-style prefixes.

If you do it regularly, I had written a template that would remove the
initials some time back.  It was easy to modify to remove all quote
prefixes as well, so it could be flexible.  I'm sure I could dig it up
if you'd find it useful.

-- 
Thanks for writing,
 Januk Aggarwal





http://www.silverstones.com/thebat/TBUDLInfo.html


Re: changing the 'from' account for a email i'm about to send?

2003-10-19 Thread Januk Aggarwal
Hello ken,

On Saturday, October 18, 2003 at 09:52 GMT -0500, legend has it that
Ken Green [KG] recited the incantation:

KG That is so cool!  I never knew about the right-click options there - I
KG had always used the Options - Active Account method.

Right click on all of the strings and icons (well, except the
column:row numbers). They all have useful options available.

-- 
Thanks for writing,
 Januk Aggarwal





http://www.silverstones.com/thebat/TBUDLInfo.html


Re: V2 Macro Library

2003-10-19 Thread Januk Aggarwal
Hi Marck,

On Wednesday, October 15, 2003 at 01:56 GMT +0100, an infinite number
of monkeys posting as Marck Pearlstone [MP] typed:

MP What I have done is to follow the v1 QT macros with v2 versions
MP below where necessary. Please feel free to check my work and suggest
MP improvements or corrections as necessary.

I was looking at the Full Name of Month macro[1], and was wondering,
why not simply use the following one line instead of the original 14
lines: %ODate=d..

[1] http://www.silverstones.com/thebat/Library.html#full+name+of+month

-- 
Thanks for writing,
 Januk Aggarwal






http://www.silverstones.com/thebat/TBUDLInfo.html


Re: V2 Macro Library

2003-10-19 Thread Januk Aggarwal
Hello Maurice,

On Sunday, October 19, 2003 at 13:01 GMT +0200, audiences applauded as
Maurice Snellen [MS] announced:

JA %ODate=d..

MS For pure English use, that would indeed be easier; however, if you
MS want to have multiple copies of this macro for multiple languages,
MS you'll have to do something like that.

Good point, I obviously wasn't thinking last night.  ;-)

MS I wish that by setting the language in a message template, we could
MS also make TB! use the names of the month in that language instead of
MS English.

Doesn't TB get those strings from Windows?  If so, it might not be
possible to translate the language easily.  If that's the case, then
maybe someone could write a plugin macro to do the job.

-- 
Thanks for writing,
 Januk Aggarwal






http://www.silverstones.com/thebat/TBUDLInfo.html


Re: E-Mail Analysis, and some regex

2003-10-01 Thread Januk Aggarwal
Hello Jonathan,

As the 14:21 GMT -0500 on Wednesday, October 1, 2003 deadline loomed,
Jonathan Angliss [JA] madly pounded out:

JA Now for a slight alteration.  Some of the reports are coming in with:

JA   The message WAS NOT delivered to:
JA   [email]:

JA I assume this will require an extension to the query,

Not really.  It depends on what information you want.  If you want to
extract the WILL BE vs. WAS NOT, then we need to do a tiny bit of
work.  If we don't care about that, then we can probably afford to
shortcut the problem.  As you noticed:

JA as I tried a simple (WILL BE|WAS NOT), and of course, it returns
JA the WAS NOT part as the email address.

The only problem with this solution is that you changed subpattern 1
to some text we don't care about.  The problem is that we're using a
shortcut with the %RegexpText.  You can keep this regexp, but then we
need to change the %Regexptext macro to 3 macros.  That is the better
solution if you think you might want to extract the delivery status at
some point.

However, if you know that you won't want any other info, then the
easiest is to simply replace the words WILL BE to .*? (no quotes).
That just means any text will be matched at that point and not put
into a subpattern. It would look like:

%_Email='%-
%RegexpText=(?im-s)^\s*The message.*?delivered to:\s*\n\s*(.*?)'%-

Note I've also changed the subpatterning to remove the angular
brackets as per your other message.  See that reply for details.

JA Would it be easier to add in an %IF statement?

You could do that, but it is probably overkill.  These relatively
simple regexps have more than enough flexibility to do what you want.

-- 
Thanks for writing,
 Januk Aggarwal







http://www.silverstones.com/thebat/TBUDLInfo.html


Re: E-Mail Analysis, and some regex

2003-10-01 Thread Januk Aggarwal
Hello Jonathan,

On Wednesday, October 1, 2003 at 12:33 GMT -0500, aliens probed
Jonathan Angliss [JA] and found:

JA These work great... Now I'll see if I can work out how to ignore the
JA  in the email addresses too now.

Just move the regular round brackets to surround the section you want
to capture.  I put them outside the angular brackets, but you can
easily move them inside the angular brackets.  In this case we aren't
using any repetition modifiers on the subpattern, so the subpatterning
is completely arbitrary.  See my reply to your other message for the
modified regexp.

 %_Tab=%Put='path\tabfile.txt'%-

JA I tried cheating on this one, and copying a tab character from notepad
JA into the editor, but it replaced it with a space, so I ended up having
JA to go with this option.

I figured that was the only way.  I suppose someone could write a
plugin macro that would let you insert any character.  But I'm not sure
I'd want to install a DLL just for that.

JA It does work great... in fact, perfectly... I adjusted the last line
JA to have a %- on it as it resulted in extra line spaces in the file
JA (might be bad cp).

JA Great work... thanks...

Excellent.  I'm glad it works.

JA now can I borrow your brain for a couple of weeks? ;)

Only if I can have Brain 2.0 installed in the interim. Of course I've
heard rumors that Money 2003 can infect Brain 2.0 and give
unrestricted access to all IP.  Unfortunately, neither is compatible
with Grad School 2004.  ;-)

-- 
Thanks for writing,
 Januk Aggarwal





http://www.silverstones.com/thebat/TBUDLInfo.html


Re: I need help adapting QTs to v2.0

2003-09-19 Thread Januk Aggarwal
Hello MAU,

On Wednesday, September 17, 2003 at 16:59 GMT +0200, a stampede was
started when Mau [M] hollered:

M Notice that I have deleted the space before the second IF and that I have
M included a %- at the and of the To and CC lines. Don't ask me why but it
M seems to work. Does it make any sense?

Yes, that makes sense. The Recipient List QT gives each address with a
newline immediately following. Before the modification to the main
template, it also added a newline, giving you two new lines.  In
otherwords, you see a blank line.  Your solution was to get rid of
the newlines added by the main template.  Alternatively, it is fairly
straight-forward to modify the regexp in the print_recipient template
to strip the extra newline from the list, but your solution works just
as well. 

-- 
Thanks for writing,
 Januk Aggarwal





http://www.silverstones.com/thebat/TBUDLInfo.html


Re: I need help adapting QTs to v2.0

2003-09-19 Thread Januk Aggarwal
Hi MAU,

On Fri, 19 Sep 2003 11:18:51 +0200, MAU wrote

 Wow! I may even be learning! ;-)

Amazing. ;-)

 Just curiosity, how would you modify 'print_recipient'? Or perhaps you
 mean modifying 'Recipient list'?

The relatively easy modification is in print_recipient.  It would be possible 
to add a %IF statement to the Recipient List template to control that last new-
line.  It is straightforward, but it needs a couple of lines instead of a 
couple of characters.

To get rid of the new line through the print_recipient template, just add the 
three characters \s* (without quotes) immediately before the \Z in the 
regexp.  In other words, make the line look like:
%SetPattRegexp=^(?s)\s{%_RL_Num_Space}(.*?)\s*\Z%-

Note, I really made two changes.  I also made the any character match (.*) 
ungreedy so that it doesn't compete with the whitespace character (\s*) match.

-- 
Good luck,
Januk




http://www.silverstones.com/thebat/TBUDLInfo.html


Re: I stink at regexp... Help.

2003-09-18 Thread Januk Aggarwal
Hi Leif,

On Thu, 18 Sep 2003 12:58:34 -0600, Leif Gregory wrote

 Here's what I got so far. Don't laugh! grin It doesn't work, at
 least it doesn't put the number after the word approve.
 
 %SETPATTREGEXP=moderat(\w+)\s(\w+)\s(\d+)
 %CLEAR
 login password
 moderate approve %SUBPATT=3  

The expression looks like it should work.  If you want to tweak your 
expression, I would have put an anchor for the beginning of the line, make the 
number of whitespaces variable and set the ignore case option explicitly.  I'm 
probably going overboard, but that's a matter of personal preference.

The reason it doesn't have a hope of working at the moment is that you forgot 
to tell TB to actually match anything.  Ie, you forgot the %RegExpBlindMatch=%
Text%- part.  Add it somewhere after the %SetPattRegexp and before the %
SubPatt macros.

-- 
Good luck,
Januk

PS: I'm not using TB for this message, so if the quote delimiter doesn't work, 
it's not my fault...really! ;-)



http://www.silverstones.com/thebat/TBUDLInfo.html


Re: I need help adapting QTs to v2.0

2003-09-16 Thread Januk Aggarwal
Hello MAU,

On Tuesday, September 16, 2003 at 11:55 GMT +0200, Mau [M] pressed
random keys until the following was produced:

snip
M Again looking in archives I found out about a QT for v2.0 called
M Recipients list. So, with v2.0 I tried this:

M Reply template as above.

Change your reply template to:

=[Begin reply template]=
- Original Message -
   From: %OFromName %OFromAddr
   Date: %ODateEn %OTimeLongEn  %IF:'%OTOLIST''':'
 To: %_RL_Text=%OTOLIST; %QINCLUDE=print_recipient' %IF:'%OCCLIST''':'
 Cc: %_RL_Text=%OCCLIST; %QINCLUDE=print_recipient'
Subject: %OFULLSUBJ

%TEXT
=[ End  reply template]=

This takes the %Comment macro out of the picture all together.  Since
the %Comment macro no longer accepts completely arbitrary text, using
a variable is safer (and shorter in this case).

M ,- [ 'print_recipient' for v2.0 ]
M | %_RL_Num_Space(9)%-
M | %_RL_Text=%Comment%-
 ^^ Delete this line
 
M | %SetPattRegexp=^(?s)\s{%_RL_Num_Space}(.*)\Z%-
M | %RegExpMatch=%-
M | %___%QInclude='Recipient List'%-
^^ Add this and make sure there
   are no trailing newline
   characters.  The new version
   doesn't delete them
   automatically.
M `-
snip
M Where I have just changed  %COMMENT=%OTOLIST;  to %COMMENT=%OTOLIST
M and %COMMENT=%OCCLIST;  to %COMMENT=%OCCLIST (I have deleted the
M semicolon and space), what I get is this:

You should change this back.  If your templates are feeding the right
format information to the Recipient List template, then your
modification risks not printing the last name/address combination.

M That is, I get 2 blank lines after each list instead of 3. But I would
M obviously like to get rid of those blank lines too and I don't know how.

That doesn't make much sense.  I don't see in your templates where
this 2 line versus 3 line thing could be happening.  It looks like
somehow you're adding two semicolons somehow, but I don't see how.

Make the modifications above and if you're still having trouble.  If
not, great, otherwise we'll continue to try and track it down.

-- 
Thanks for writing,
 Januk Aggarwal







http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Not _

2003-09-03 Thread Januk Aggarwal
Hello Mark,

On Wednesday, September 3, 2003 at 22:49 GMT +0200, special agents
were informed that Mark Partous [MP] leaked:

MP Is there an easy way to exclude the underscore character from the rule,

JA Use two inverses:
JA [^\W_]{40,}

MP Still one problem: how do I include this kind of character:

MP é'(§è!çàà)-

Sorry, I'm not entirely sure which of those you want included.
However, the idea is fairly simple, so let's go through the logic at
least so you can play around and get the expression which will work
for you.

1. [^\W_] - what we did is use the fact that in regexps you can define
character classes.  Those are simple OR statements for
each character included.  In this case \W OR _ are
matched.  But then we negated that, so anything EXCEPT \W
OR _ is matched.

2. Now we want to match some specific characters which were EXCLUDED
   because they are matched by \W.  So you need to do some type of OR
   statement.  But we have to do a more complicated OR statement than
   simple characters because we want to have the statement above OR'ed
   with our next character class.

So the easiest thing to do is have an expression like:

([^\W_]|[-é'(§è!çàà)]){40,}

This probably won't work quite as written.  You may need to escape
some of the special characters for either the filter engine's sake, or
for the regexp engine's sake.  Note that I put the dash at the
beginning of the character class because it has special meaning if it
is anyplace else.

MP BTW: _very_ late answer to your reply!  :-)

Not everything needs to have urgent priority. :-)

-- 
Thanks for writing,
 Januk Aggarwal






http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Trying to strip empty lines from quoting...

2003-08-14 Thread Januk Aggarwal
Hello George,

It was Tuesday, August 12, 2003 at 11:26 GMT +0300, when George M.
Menegakis [GMM] wrote:

GMM That   is,  it  merges  lines  not separated by empty line. Can we avoid
GMM this?

Yes, see the modified version in my previous message.

-- 
Thanks for writing,
 Januk Aggarwal






http://www.silverstones.com/thebat/TBUDLInfo.html


Re: wrap to certain length

2003-08-14 Thread Januk Aggarwal
Hello Dima,

On Mon, 11 Aug 2003 12:37:46 +0400, Dima wrote

 I need to make %Quotes not larger than, say, 50 chars.

 Is there a macro to wrap text to a certain length?

This can be done in the current beta, but not the release version.  Since you 
appear to be using the beta series, I'll point you to:
http://www.mail-archive.com/[EMAIL PROTECTED]/msg27966.html

It has two templates, a recursive wrapping engine template and a driver 
template.  You need both, and %QINCLUDE the driver template into your main 
template.  The driver template calls the wrapping engine template.

NOTE
These templates will **NOT** work with the 1.62 release version.
You **must** use 1.63 beta 11 or higher for the templates to work.


-- 
Thanks for writing,
Januk Aggarwal



http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Not _

2003-08-14 Thread Januk Aggarwal
Hello Mark,

On Friday, August 8, 2003 at 11:13 GMT +0200, a stampede was started
when Mark Partous [MP] hollered:

MP \w{40,}

MP Unfortunatly (???) this also catches replies to my own messages that have a
MP line consisting of 40+ _ characters.

MP Is there an easy way to exclude the underscore character from the rule,

Use two inverses:
[^\W_]{40,}

-- 
Thanks for writing,
 Januk Aggarwal







http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Trying to strip empty lines from quoting...

2003-08-14 Thread Januk Aggarwal
Hello George,

On Tuesday, August 12, 2003 at 09:40 GMT +0300, George M. Menegakis
[GMM] pressed random keys until the following was produced:

Before we start, a question for the moderators:
 How should we handle Tech questions involving features
 from the Beta series? This thread doesn't seem to fit on
 any of the lists terribly well.

GMM My  mistake.  What  I  wish  is  to  strip  empty  lines  or lines with
GMM whitespaces from quoting. Just what the perl mini program I wrote, did.

Ah, I misunderstood.  See below.

GMM I  will  try to see if I can modify your template although the syntax of
GMM macros comfuse me totally.

Well, Perl syntax confuses me, so let's call it even. ;-)

As for you request, it's fairly easy to modify the template I had
provided.  If I understand you, something like:

,-- [ example ]
| Paragraph 1
| 
| Paragraph 2
`--
Would become:
,-- [ example ]
| Paragraph 1
| Paragraph 2
`--

If that's not what you meant, could you please give an example?

If you do want what I described above, see the following:
Note I've renamed the QT and the variable prefixes to give
a slightly more accurate description.

DISCLAIMER
For anyone else reading this, do **NOT** use these templates if you
have TB version 1.63b7 or earlier.
**

=[Begin Strip QT]=
%REM='
   Blank line stripping routine using features from TB 1.63b11
   Written August 2003 by Januk Aggarwal

   Notes:
  1. This template can be used alone to modify clipboard
 contents or can be used as an engine by assigning text to
 the variable, %_Strip_Text, in the driver template.
'%-
%-
%IF:'%_Strip_FirstTime'='':'%-
%___%IF:%_Strip_Text=:%_Strip_Text(%Clipboard)%-
%___%_Strip_FirstTime=No'%-
%-
%IF:'%_Strip_Text''':'%-
%-
%SetPattRegexp=(?is-m)^(.*?)(\n(.*)|)\z%-
%RegexpBlindMatch(%_Strip_Text)%-
%-
%_Strip_Line_1(%Subpatt(1))%-
%_Strip_Remainder_Of_Text(%Subpatt(3))%-
%-
%If:%-
%%SetPattRegexp=!^\s*$!%-
%%RegexpMatch=!%_Strip_Line_1 !=:%-
%%_Strip_Line_1
%-
%-
%_Strip_Text(%_Strip_Remainder_of_Text)%-
%-
%QInclude(Strip)'%-
=[ End  Strip QT]=

So your main template would need something like:

=[Begin Template Extract]=
%_Strip_Text(%Quotes)%-
%QInclude(Strip)%-
=[ End  Template Extract]=

-- 
Thanks for writing,
 Januk Aggarwal






http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Trying to strip empty lines from quoting...

2003-08-12 Thread Januk Aggarwal
Hello George,

On Monday, August 11, 2003 at 11:32 GMT +0300, a stampede was started
when George M. Menegakis [GMM] hollered:

GMM The  last  two days I tried to create a reply template that quotes lines
GMM that are not empty or have only whitespaces.

You'll need to use a recursive template.  These are much easier in the
current beta series (1.63b8 or later).  Since you appear to be using
the current beta, you can try the following engine.

Note: This template will ***NOT*** work in versions 1.63b7 or lower.

=[Begin ReQuote QT]=
%REM='
   Blank line quoting routine using features from TB 1.63b11
   Written August 2003 by Januk Aggarwal

   Notes:
  1. This template can be used alone to modify clipboard
 contents or can be used as an engine by assigning text to
 the variable, %_RQ_Text, in the driver template.
'%-
%-
%IF:'%_RQ_FirstTime'='':'%-
%___%IF:%_RQ_Text=:%_RQ_Text(%Clipboard)%-
%___%_RQ_FirstTime=No'%-
%-
%IF:'%_RQ_Text''':'%-
%-
%SetPattRegexp=(?is-m)^(.*?)(\n(.*)|)\z%-
%RegexpBlindMatch(%_RQ_Text)%-
%-
%_RQ_Line_1(%Subpatt(1))%-
%_RQ_Remainder_Of_Text(%Subpatt(3))%-
%-
%If:%-
%%SetPattRegexp=!^\s*$!%-
%%RegexpMatch=!%_RQ_Line_1 !:%-
% %_RQ_Line_1
%-
%_RQ_Text(%_RQ_Remainder_of_Text)%-
%-
%QInclude(ReQuote)'%-
=[ End  ReQuote QT]=

So your main template would need something like:

=[Begin Template Extract]=
%_RQ_Text(%Quotes)%-
%QInclude(ReQuote)%-
=[ End  Template Extract]=

-- 
Thanks for writing,
 Januk Aggarwal

Using The Bat! 1.63 Beta/11 under Windows 98 4.10 Build  A




http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Trying to strip empty lines from quoting...

2003-08-12 Thread Januk Aggarwal
Hello George,

Tuesday, August 12, 2003 at 10:53 GMT +0300, was when inspiration
required George M. Menegakis [GMM] to compose:

GMM This is exactly what I mean! The problem is that the quick template that
GMM you kindly provided doesn't strip empty lines. It keeps quoting them.

The one in my last posting too?  It stripped all blank lines here...

GMM Basically what I wanted was is to compress 2 or more empty lines to one.
snip
GMM I  thought  that  it was not possible (using template language) till I
GMM saw  that block quote did this.

My wrap template does this too.  Just removing the macro that actually
wraps the text, find:

=[Begin wrap_mod QT]=
%REM='
   Modified Multi-Paragraph wrapping routine using features from
   TB 1.63b11 
   Written August 2003 by Januk Aggarwal

   Notes:
  1. This template can be used alone to wrap clipboard
 contents or can be used as a wrapping engine by assigning
 text to the variable, %_Wrap_Text, in the driver template.
'%-
%-
%IF:'%_Wrap_FirstTime'='':'%-
%___%IF:%_Wrap_Text=:%_Wrap_Text(%Clipboard)%-
%___%_Wrap_FirstTime=No'%-
%-
%IF:'%-
%SetPattRegexp=(?is-m)[^\n]+%-
%RegexpMatch(%_Wrap_Text)''':'%-
%-
%SetPattRegexp=(?is-m)^(.*?)((\n((\w{0,5}(\\s*)+)?\s*\n)+)(.*)\s*$|\z)%-
%RegexpBlindMatch(%_Wrap_Text)%-
%-
%_Wrap_Paragraph_1(%Subpatt(1))%-
%_Wrap_Blank_Space(%Subpatt(3))%-
%_Wrap_Remainder_Of_Text(%Subpatt(7))%-
%-
%Quotes(%_Wrap_Paragraph_1)

%_Wrap_Text(%_Wrap_Remainder_of_Text)%-
%-
%QInclude(wrap_mod)'%-
=[ End  wrap_mod QT]=

The part in your main template would be something like:

=[Begin]=
%_Wrap_Text=%Text%-
%Qinclude=wrap_mod%-
=[ End ]=


GMM  But as I said the syntax of templates is
GMM confusing  me.  I know I should try to understand it (due its tremendous
GMM power), but before doing this I should learn how to think in regex.

Well, the regex and the templates can be learned separately,
especially in the current betas.  Obviously the regular expressions
give a huge amount of power, but you can still do a fair bit with
minimal knowledge of TB's regexps.

-- 
Thanks for writing,
 Januk Aggarwal






http://www.silverstones.com/thebat/TBUDLInfo.html


Re: next line after symbol I know

2003-07-17 Thread Januk Aggarwal
Hello Dr.GAD,

On Thursday, July 17, 2003 at 09:55 GMT +0300, audiences applauded as
Dr.Gad [DG] announced:

DG is  it  possible  to  do  following?  I have some text and... there is
DG always  one line which ends with ) [RIGHT PARANTHESIS]. and all I need
DG is to get next line after this. example:

Use a regexp, such as:

%SetPattRegexp=(?-s)\)\n(.*?)\n%-
%RegexpMatch=%OText%-

-- 
Thanks for writing,
 Januk Aggarwal






http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Some Newbie Questions...

2003-07-05 Thread Januk Aggarwal
Hello choppystride,

On Saturday, July 5, 2003 at 20:48 GMT -0400, crowds cheered as
Choppystride [C] unveiled:

C 1) In my haste to start using using TB, I set up a lot (over 2 dozen) of
C email accounts and just accepted the default templates (New, Reply,
C Forward, etc.) for each account.  Now, after about 2 weeks of using
C TB, I would like to change them all but it seems that I need to
C change them one account at a time.  Is there a faster way to do this?
C i.e. is there a centralized way to change the default templates so
C that the changes will also apply to all existing accounts?

Unfortunately, you'll have to change them all individually the first
time.  But, since you're doing all this work anyway, you should
consider using quick templates.  Then the account default templates
will all be one line:
%QInclude=QT name%-

Using quick templates, you can centralize or personalize your
templates as necessary.  Just remember to tick the box that says
Share with other accounts.  In case you hadn't already found them,
quick templates can be accessed by going to: Options - Quick
templates

While you're at it, check out the Macro repository for some Quick
Templates you may find useful: http://www.silverstones.com/thebat/Library.html

C Can I configure TB so that it can automatically move to the next
C message above?

Not that I'm aware of.  Of course you can define different sorting
orders for the main window and the folder view (double click on a
message, then select: View - Message List

So you may be able to simulate the behaviour you want.

C Is there a easy way for me to configure TB to call an external
C program (i.e. as a menu item, a button, a shortcut, etc.) so that
C it can run my script?

Create a manual filter that does nothing and assign it a hotkey.
Under the Actions tab you can Run External Program.  There is a
trick in selecting options so that the filter will run in any folder
and not move the current message to the inbox.  I don't remember
exactly what options you should use, but I'm sure someone here will
fill in the details.

-- 
Thanks for writing,
 Januk Aggarwal




http://www.silverstones.com/thebat/TBUDLInfo.html


Re: The wq reply template

2003-06-21 Thread Januk Aggarwal
Hello Bill,

On Saturday, June 21, 2003 at 18:10 GMT -0400, authorities charged
Bill Mccarthy [BM] for writing:

BM Yes, that's what I meant by different behavior - it's not a criticism,

I didn't take it as criticism.  I just wanted to make sure the
different behavior was clarified.

 Again, this is only useful for quoted blank lines like:

BM Well, yes, yes and no.  Your regex won't treat the last one as a blank
BM line.  Fortunately, quoting `JA` will usually give `JA`.

Of course you're right.  That'll teach me to review my regexps too
quickly. ;-) 

BM If, for example, I tried to wrap:
snip
BM I get:

Hmm, looks like that's a bug/change of how %wrapped works.  ALT-L
gives the behaviour you describe as well.  I was pretty sure that TB
used to handle prefixes of that form.

-- 
Thanks for writing,
 Januk Aggarwal

Using The Bat! 1.63 Beta/11 under Windows 98 4.10 Build  A





http://www.silverstones.com/thebat/TBUDLInfo.html


Re: The wq reply template

2003-06-20 Thread Januk Aggarwal
Hello Bill,

On Friday, June 20, 2003 at 23:39 GMT -0400, electricians were shocked
that Bill Mccarthy [BM] potentially scribbled:

BM Those 9 lines, could be replaced by these 4:
snip
BM This eliminates 3 variables and, IMO, making the code a little
BM clearer.

I don't know if that's much clearer.  For you and me, maybe.  But the
reason for using the descriptive variables is to make it easier for
others to understand the macros and modify them for their personal
needs.  Don't forget, not everyone knows how to read a regexp.  Trying
to figure out what information is available for the user is very
non-trivial.

Plus by putting the output of the subpatterns into variables, it
allows for more complex uses and for easier updates if the regexp
needs to be modified.

You want an example with the wrap2 template?  Check out:
mid:[EMAIL PROTECTED]


-- 
Thanks for writing,
 Januk Aggarwal






http://www.silverstones.com/thebat/TBUDLInfo.html


Re: adding blank lines when wrapping quotes? and merging quicktemplates?

2003-06-17 Thread Januk Aggarwal
Hello Domagoj,

On Monday, June 16, 2003 at 14:37 GMT +0200, electricians were shocked
that Domagoj Klepac [DK] potentially scribbled:

DK If (there's a capital letter at the start of a new line) AND (the
DK  previous line ends before wrapcolumn minus length of first word
DK  in the new line)
DKinsert new line
DK else if (there's two or more spaces or tab in the start of a new
DK  line)

A quibble with this condition: what if all the text is indented, like:

  This is some test text.  It really doesn't matter what I type here,
  just so long as I have a few lines.  After all, this is just a demo
  of an indented paragraph.

DKinsert new line
DK else
DKdo nothing
DK end if
snip
DK But I don't think this can be done in TB!. :( :)

Well, it can be done, but it would be a *lot* of work, especially in
the release version.  Even with some of the new features in the
beta version, this would involve multiple recursive templates and
non-trivial ones at that.  But it could be done if someone was
enterprising enough...*

-- 
Thanks for writing,
 Januk Aggarwal

* I no longer have time to be that enterprising, at least not on a
  volunteer basis.






http://www.silverstones.com/thebat/TBUDLInfo.html


Re: adding blank lines when wrapping quotes? and merging quicktemplates?

2003-06-14 Thread Januk Aggarwal
Hello Charlie,

An archeological dig discovered that on Saturday, June 14, 2003 at
21:43 GMT +1000, Charlie Laidlaw [CL] chiseled the following:

CL 1. If anyone could modify ReWrap to do this for me, i'd be very grateful.
CL I would guess that that detecting a long string of blanks would be the
CL best trigger to somehow make it skip a line?

You can try something like:

=[Begin replacement wrap2]=
%REM=This is a specialized version of the wrap2 template.
  It is modified to require 5 or more spaces and a new-line as the
  delimiter for paragraphs.

  Modified June 14, 2003 by Januk Aggarwal
%-
%IF:'%-
%SETPATTREGEXP=(?is-m)[^\n]+%-
%REGEXPMATCH=%COMMENT''':'%-
%-
%WRAPPED=_%SETPATTREGEXP=(?is-m)^(.*?)(\s{5,}\n(.*)\s*$|\z)%-
%-%-%-%-%-%REGEXPBLINDMATCH=%COMMENT%-
%-%-%-%-%-%SUBPATT=1_

%COMMENT=_%SETPATTREGEXP=(?is-m)^(.*?)(\s{5,}\n(.*)\s*$|\z)%-
%-%-%-%-%-%REGEXPBLINDMATCH=%COMMENT%-
%-%-%-%-%-%SUBPATT=3_%-
%QINCLUDE=wrap2'
=[ End  replacement wrap2]=

I can't exactly try this template because of changes in the current
beta, but that should work.  It detects 5 or more spaces followed
by a newline character as the delimiter between paragraphs.

CL 2. I quite like the look of Marck's 'Quote Extraction' also
CL www.silverstones.com/thebat/Library.html#quote+extractionlooks . So
CL i'd also like my replies to first execute Marck's Quote Extraction on
CL the original letter, and then Januk's ReWrap on the extracted 
CL cleaned-up material. How can i do this?

You need a driver template for wrap2 anyway, so you can specify what
you feed it.  Try something like:

=[Begin driver template]=
%Comment=%QInclude='quote extraction QT'%-
%QInclude=wrap2%-
%Comment=%-
=[ End  driver template]=


-- 
Thanks for writing,
 Januk Aggarwal

Using The Bat! 1.63 Beta/11 under Windows 98 4.10 Build  A






http://www.silverstones.com/thebat/TBUDLInfo.html


Re: adding blank lines when wrapping quotes? and merging quicktemplates?

2003-06-14 Thread Januk Aggarwal
Hello Charlie,

On Sunday, June 15, 2003 at 12:28 GMT +1000, a stampede was started
when Charlie Laidlaw [CL] hollered:

CL you make perfect sense Peter, though Januk seems to think it may be
CL possible with a small solution. i have no clue about this, as i'm sure
CL you can tell. thanks for replying to my query.

Don't get me wrong.  What Bill and Peter told you is quite correct.
I made a *very* simplistic engine based on your statement that the
paragraphs always end with a bunch of white space characters and a new
line.  Mine was by no means a general solution.

I also would not have been able to test the text you pasted in because
TB will strip trailing spaces.  So even if they did exist in the
source, it is very unlikely that I would have seen them in your post.

-- 
Thanks for writing,
 Januk Aggarwal





http://www.silverstones.com/thebat/TBUDLInfo.html


Re: change quote character

2003-06-03 Thread Januk Aggarwal
Hello David,

On Monday, June 2, 2003 at 09:49 GMT -0400, an infinite number of
monkeys posting as David [D] typed:

D No, what was happening is, if I had, say, three paragraphs separated
D by blank lines, wrap2 and bqq were stripping the blank lines.

That shouldn't be happening, you should have one blank line between
each paragraph with the original wrap2 template.  The one on the
website looks right, did you copy and paste it *exactly* as written
there? (ie, not deleting any blank lines or adding any %- macros)

D Your new version of wrap2 is leaving the blank lines, but alas, it is
D also causing weird multiple quotation:

Yeah, that would be because I miscounted the subpatterns.  (I did warn
you I might be rusty.)  See below for the fix.

=[Begin modified wrap2]=
%IF:'%-
%SETPATTREGEXP=(?is-m)[^\n]+%-
%REGEXPMATCH=%COMMENT''':'%-
%-
%WRAPPED=_%SETPATTREGEXP=(?is-m)^(.*?)(\n(((\w{0,5}(\\s*)+)?\s*\n))+(.*)\s*$|\z)%-
%-%-%-%-%-%REGEXPBLINDMATCH=%COMMENT%-
%-%-%-%-%-%SUBPATT=1_%-
%-
%SETPATTREGEXP=(?is-m)^(.*?)((\n(((\w{0,5}(\\s*)+)?\s*\n))+)(.*)\s*$|\z)%-
%REGEXPBLINDMATCH=%COMMENT%-
%SUBPATT=3%-
%-
%COMMENT=_%SETPATTREGEXP=(?is-m)^(.*?)(\n(((\w{0,5}(\\s*)+)?\s*\n))+(.*)\s*$|\z)%-
%-%-%-%-%-%REGEXPBLINDMATCH=%COMMENT%-
%-%-%-%-%-%SUBPATT=7_%-
%QINCLUDE=wrap2'
=[ End  modified wrap2]=

This is still untested, but only the middle regexp was changed.  I
merely added a pair of parentheses to capture the blank lines in
their own subpattern.

I'll break down one of these regexps since all three are the same,
except maybe for some subpattern capturing.  This won't be my most
stellar explanation, but it might give you a reasonable start.

(?is-m)  - Option setting
   - Ignore case (not necessary), dot all, not multiline
   
^- Match beginning (not of any line because of multiline
   being unset above)

(.*?)- Match the minimum number of any character that allows
   the rest of the expression to match and store it in
   subpattern 1 

Note the rest of the pattern is captured in subpattern 2, so I'll
break it down a bit differently.  Since the critical part of this
regexp is simply detecting blank lines, let's focus on that
part.  Note, this section is now captured in subpattern 3 so it
can be extracted.

((\n - Start subpatterns 2  3 and require a newline character

(((  - Start subpatterns 4, 5 and 6 respectively (needed for
   repeat operators)

\w{0,5}  - Look for upto 5 alphanumeric characters starting the
   line (for initials or name quoting).

 (\\s*)+- Look for one or more quote characters .  They can be
   separated by as much or as little white space as
   needed.  The quote character  whitespace deal are in
   subpattern 7 simply for the repeat operator.

)?   - Close subpattern 6 and allow 0 or 1 instances of this
   entire subpattern.  This is because a blank line
   could be truly blank, or it could have been quoted by
   the mail client.

\s*\n)   - Get as much whitespace as necessary and require a
   newline.  This ensures that we do have at least one
   blank line  between the first paragraph and the
   second.  Capture this blank line in subpattern 5.

)+)  - Close subpattern 4 (which seems to be the same as
   5...I don't remember why I did that...) and look for
   one or more instances of these blank lines.  All of
   this is captured in 3.  So all the blank lines are in
   subpattern 3.  Note the end of line for the end of the
   first paragraph is also in this subpattern.

Now for the cleanup:

(.*)\s*$- Capture the rest of the paragraphs in subpattern 8

|\z)- Or look for the end of the text instead of all the
  newline junk.  Necessary if you are processing the last
  paragraph, which might not be terminated with a blank
  line.  Close subpattern 2. 

-- 
Thanks for writing,
 Januk Aggarwal





http://www.silverstones.com/thebat/TBUDLInfo.html


Re: change quote character

2003-06-02 Thread Januk Aggarwal
Hello David,

On Sunday, June 1, 2003 at 14:48 GMT -0400, special agents were
informed that David [D] leaked:

D Everything except leaving the initial blank lines.  It wraps just like
D it's supposed, and puts it in boxquotes, and no longer has weird
D character additions, etc., but it still doesn't keep the original
D blank lines.

Do you mean that the paragraphs are only separated by one blank line
instead of the 4 or 5 or 10 that there might have been originally?  If
so, that's by design of the wrap2 template.  You could change that by
making the wrap2 template look like:

=[Begin modified wrap2]=
%IF:'%-
%SETPATTREGEXP=(?is-m)[^\n]+%-
%REGEXPMATCH=%COMMENT''':'%-
%-
%WRAPPED=_%SETPATTREGEXP=(?is-m)^(.*?)(\n(((\w{0,5}(\\s*)+)?\s*\n))+(.*)\s*$|\z)%-
%-%-%-%-%-%REGEXPBLINDMATCH=%COMMENT%-
%-%-%-%-%-%SUBPATT=1_%-
%-
%SETPATTREGEXP=(?is-m)^(.*?)(\n(((\w{0,5}(\\s*)+)?\s*\n))+(.*)\s*$|\z)%-
%REGEXPBLINDMATCH=%COMMENT%-
%SUBPATT=2%-
%-
%COMMENT=_%SETPATTREGEXP=(?is-m)^(.*?)(\n(((\w{0,5}(\\s*)+)?\s*\n))+(.*)\s*$|\z)%-
%-%-%-%-%-%REGEXPBLINDMATCH=%COMMENT%-
%-%-%-%-%-%SUBPATT=7_%-
%QINCLUDE=wrap2'
=[ End  modified wrap2]=

That should work, though it is untested, and I may be rusty.

-- 
Thanks for writing,
 Januk Aggarwal






http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Problem with my BU.bat

2003-03-15 Thread Januk Aggarwal
Hello Tim,

Saturday, March 15, 2003 at 15:18 GMT -0500, was when inspiration
required Tim Musson [TM] to compose:

TM | ::Ok, lets shut TB down!
TM | C:\Program Files\The Bat!\thebat.exe /EXIT
TM | 
TM | ::We should wait for TB to exit...
TM | :: possibly find a programmatic way to check?
TM | :: or, if not, use sleep?
TM | pause

You can use one line for this:

start /w C:\Program Files\The Bat!\thebat.exe /EXIT


-- 
Thanks for writing,
 Januk Aggarwal




 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Reply-to-All ignoring myself

2003-03-10 Thread Januk Aggarwal
Hello Jonathan,

On Sunday, March 9, 2003 at 17:16 GMT -0600, authorities charged
Jonathan Angliss [JA] for writing:

JA I don't want the email to always CC itself to everybody but me...
JA I only want that to happen on certain events, like when I hit
JA reply-to-all.

JA Okay so I think I can probably get away with replacing %OTOLIST
JA and %OCCLIST with %TOLIST, and %CCLIST... Logical assumption for
JA me... I was wrong. It doesn't work at all... nothing gets changed.
JA So what's wrong with it? Or is there any easier safer way?

What about looking for multiple addresses in the %TOLIST and %CCLIST?

Just a guess, but maybe something like:

%IF:_%SetPattRegExp=@.*@%RegExpMatch=%TOLIST%CCLIST___:_%-
%CC=''%TO=''%TO='%SETPATTREGEXP=''^(.*?)[,;]?\s*$''%-
%REGEXPMATCH=''%-
%SETPATTREGEXP=^(.*?[,;]?)([^,;]*%-
([EMAIL PROTECTED]|[EMAIL PROTECTED])?%-
[^,;]*[,;]?)(.*)$%-
%REGEXPBLINDMATCH=%OTOLIST, %OCCLIST%-
%SUBPATT=1%SUBPATT=4'''_

Note this is not tested...

-- 
Thanks for writing,
 Januk Aggarwal




 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Problems with Januk's Recipient list -Indented macro

2003-03-10 Thread Januk Aggarwal
Hello Nick,

On Monday, March 10, 2003 at 14:53 GMT +, something compelled Nick
Dutton [ND] to inscribe:

ND I can't seem to make this macro work at all. It seems to me that
ND print_recipient2 is not getting called properly, or at all; the
ND lines after To, CC, BCC are always blank.

ND I've tried inserting text markers to indicate QT calls, and have
ND never seen the ones for print_recipient2 appear.

All of your templates seem to be ok.  The only thing I can think of to
check is that you've spelled the names of the templates correctly.  If
you want to change the names, just make sure you make the change in
the templates that call the others as well.

Note:  I updated the regexps in print_recipient2 to handle special
cases a bit better.  You may want to try it:

=[Begin print_recipient2]=
%REM='
  Recipient List reformating routine.
  recipient2 = recursive engine QT
  
  Written by Januk Aggarwal
  November 2002
'%-
%-
%IF:'%-
%SETPATTREGEXP=$(?i)^\d*\n\s*((\?)(.*?)\2\s*(\.*?\)?\s*[;,]\s*)$%-
%REGEXPMATCH=$%COMMENT$''':'%-
%-
%SETPATTREGEXP=\s{%-
%-%-%SETPATTREGEXP=#^\d*#%-
%-%-%REGEXPMATCH=#%COMMENT#}%-
%REGEXPMATCH=%-
%-
%SETPATTREGEXP=$(?i)^\d*\n\s*(((\?)(.*?)\3\s*(\.*?\)?)\s*[;,]\s*)?$%-
%REGEXPBLINDMATCH=$%COMMENT$%-
%SUBPATT=$2$
%-
%COMMENT=_%-
%-%-%SETPATTREGEXP=$(?i)^(\d*\n)\s*((\?)(.*?)\3\s*(\.*?\)?\s*[;,]\s*)?(.*)$%-
%-%-%REGEXPBLINDMATCH=$%COMMENT$%-
%-%-%SUBPATT=$1$%-
%-%-%SUBPATT=$6$_%-
%-
%QINCLUDE=print_recipient2'%-
=[ End  print_recipient2]=

ND I'm no regex expert, but I'm clear on what's going on up until
ND line 3 of print_recipient - please, no laughing!

I don't have time to explain it right now, but I'll try to post a
summary tonight or tomorrow (unless someone else wants to take a shot
at it.) 

-- 
Thanks for writing,
 Januk Aggarwal

Using The Bat! 1.63 Beta/7 under Windows 98 4.10 Build  A

Is it OK to use the AM radio after noon?





 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: [eng] Re: Question about Januk's print template

2003-03-10 Thread Januk Aggarwal
Hello Miguel,

On Sunday, March 9, 2003 at 11:31 GMT +0100, an infinite number of
monkeys posting as Miguel A. Urech [MAU] typed:

Sorry I somehow missed your reply.

 1. Change the reply template so you remove the % symbol from in front
of the %COMMENT macros and the %QINCLUDE macros.
  - This will show us what exactly is being sent to print_recipient

MAU  To: COMMENT=[EMAIL PROTECTED]; QINCLUDE=print_recipient
MAU  To: COMMENT=Miguel A. Urech [EMAIL PROTECTED]; QINCLUDE=print_recipient

Ok, so this makes me confident that the problem is not in your main
template.

 2. Reverse the change above and change the last line in the
print_recipient template from %COMMENT= to %COMMENT
  - This will let us see how far the print_recipient2 template got
before failing.

MAU  To:
MAU  To:

This one is less clear.  I don't really understand why it should be
blank.  Can you please try the following two modifications (one at a
time would be good) to your print_recipient template:

,- [ My print_recipient ]
| %COMMENT=9
| %COMMENT%-
| %COMMENT
| %SETPATTREGEXP=(?s-m)^\s{9}(.*)\n$%-
| %REGEXPMATCH=%QINCLUDE='print_recipient2'%-
| %COMMENT=%-
`-

,- [ My print_recipient ]
| %COMMENT=9
| %COMMENT%-
| SETPATTREGEXP=(?s-m)^\s{9}(.*)\n$%-
| REGEXPMATCH=%QINCLUDE='print_recipient2'%-
| %COMMENT=%-
`-

 3. Reverse the change above and *add* a line to the beginning of the
print_recipient2 template. Put the macro %COMMENT= as the very
first line of print_recipient2.
  - This will tell us if print_recipient2 is being called, and what
text is being sent to be processed.

MAU  To:
MAU  To:

This is just mystifying, however, in light of Nick's problem 
solution, I don't know what to think.

 4. Reverse the change above and change print_recipient2 to the
following.
  - This template is slightly modified to ignore some more
white space.  The modification shouldn't hurt the performance
of the template in normal cases.

MAU  To:
MAU  To:

Hmm, and you said that this is the same output as when you run the
version in mid:[EMAIL PROTECTED]...  The plot
thickens.

Sorry I'm making you do all these changes, but I can't replicate the
problem over here to test my brainstorming ideas.

One thing we should consider: if this is only happening on two
specific messages, _but_NO_others_, we may be beating a dead horse here.
It would be nice to understand why the templates failed, but we should
think about how much time is being spent versus how widespread the
problem is.

-- 
Thanks for writing,
 Januk Aggarwal





 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Problems with Januk's Recipient list -Indented macro

2003-03-10 Thread Januk Aggarwal
 whitespace.

)?   - Find one or 0 instance of subpattern 2.  In other words, it
   can find or ignore the first item in the list.  In all
   honesty, I don't remember why this was important, but with
   a little thought one could probably work it out.

Back to the last part of the main expression:
   
(.*) - Find the maximum number of any characters that will allow
   the rest of the pattern to work and store them in
   subpattern 6.  This is to capture all the remaining items
   on the list so they can be passed on to the next round.

Ok, so maybe that wasn't so much of a short summary as it was a
detailed analysis, but hopefully it was useful.  I hope that helps
clear it up a bit.  As I said, this pattern is used 3 times, though
the division of the subpatterns is a bit different depending on what
specifically needs to be extracted. 

-- 
Thanks for writing,
 Januk Aggarwal





 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: [eng] Re: Question about Januk's print template

2003-03-08 Thread Januk Aggarwal
Hello Miguel,

On Sunday, March 9, 2003 at 01:25 GMT +0100, a beagle known as Miguel
A. Urech [MAU] barked:

I don't see any problem with your templates, so there must be
something odd being passed to the print_recipient2 template.

For testing purposes, let's try a few things to figure out what's
happening:

1. Change the reply template so you remove the % symbol from in front
   of the %COMMENT macros and the %QINCLUDE macros.
 - This will show us what exactly is being sent to print_recipient

2. Reverse the change above and change the last line in the
   print_recipient template from %COMMENT= to %COMMENT
 - This will let us see how far the print_recipient2 template got
   before failing.

3. Reverse the change above and *add* a line to the beginning of the
   print_recipient2 template. Put the macro %COMMENT= as the very
   first line of print_recipient2.
 - This will tell us if print_recipient2 is being called, and what
   text is being sent to be processed.

4. Reverse the change above and change print_recipient2 to the
   following.
 - This template is slightly modified to ignore some more
   white space.  The modification shouldn't hurt the performance
   of the template in normal cases.

=[Begin print_recipient2]=
%REM='
  Recipient List reformating routine.
  recipient2 = recursive engine QT

  Written by Januk Aggarwal
  November 2002
'%-
%-
%IF:'%-
%SETPATTREGEXP=$(?i)^\d*\n\s*?(\?(.*?)\?\s*(\.*?\)?\s*[;,]\s*)$%-
%REGEXPMATCH=$%COMMENT$''':'%-
%-
%SETPATTREGEXP=\s{%-
%-%-%SETPATTREGEXP=#^\d*#%-
%-%-%REGEXPMATCH=#%COMMENT#}%-
%REGEXPMATCH=%-
%-
%SETPATTREGEXP=$(?i)^\d*\n\s*?((\?(.*?)\?\s*(\.*?\)?)\s*[;,]\s*)?$%-
%REGEXPBLINDMATCH=$%COMMENT$%-
%SUBPATT=$2$
%-
%COMMENT=_%-
%-%-%SETPATTREGEXP=$(?i)^(\d*\n)\s*?(\?(.*?)\?\s*(\.*?\)?\s*[;,]\s*)?(.*)$%-
%-%-%REGEXPBLINDMATCH=$%COMMENT$%-
%-%-%SUBPATT=$1$%-
%-%-%SUBPATT=$5$_%-
%-
%QINCLUDE=print_recipient2'%-
=[ End  print_recipient2]=

MAU If I use a template with To: %OTOLIST I get:

MAUTo: [EMAIL PROTECTED]
MAU and
MAUTo: Miguel A. Urech [EMAIL PROTECTED]

That seems ok.  Test number 1 above should give me the last bit of
confidence to rule this out as the source of the problem.

-- 
Thanks for writing,
 Januk Aggarwal




 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Question about Januk's print template

2003-03-04 Thread Januk Aggarwal
Hello Miguel,

On Tuesday, March 4, 2003 at 14:57 GMT +0100, a creature mimicking
Miguel A. Urech [MAU] wrote:


MAU To a reply template as follows changing TOLIST to OTOLIST, etc.
snip
MAU |  Cc: %COMMENT=%OCCLIST; %QINCLUDE=print_recipient' %IF:'%BCCLIST''':'
MAU | Bcc: %COMMENT=%BCCLIST; %QINCLUDE=print_recipient'

By the way, you'd probably want to change the BCCList macro.

-- 
Thanks for writing,
 Januk Aggarwal





 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Template to Remove Leading Spaces

2003-02-25 Thread Januk Aggarwal
Hello Carsten,

On Monday, February 24, 2003 at 11:04 GMT +0100, clairvoyants were
mystified when Carsten Thönges conjured:

 * Januk Aggarwal [EMAIL PROTECTED] writes:

Do you mind removing the address from the body of your replies please?
This way spammers can harvest my address from the archives.  At least
addresses in the headers are hidden in the archives.

 Why? Just because those QT pairs are much simpler to create and
 debug...

True.

-- 
Thanks for writing,
 Januk Aggarwal





 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Template to Remove Leading Spaces

2003-02-24 Thread Januk Aggarwal
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


Re: Yahoo! groups - trimming prefix

2003-02-23 Thread Januk Aggarwal
Hello Taco,

On Sunday, February 23, 2003 at 19:05 GMT +1000, legend has it that
Taco Fleur recited the incantation:

 how do I unsubscribe from this list?

 Specials - Mailing List - Unsubscribe
 
-- 
Thanks for writing,
 Januk Aggarwal




 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Yahoo! groups - trimming prefix

2003-02-23 Thread Januk Aggarwal
Hello Steve,

On Sunday, February 23, 2003 at 09:00 GMT +, aliens probed Steve
Hill [SH] and found:

SH I subscribe to a lot of Yahoo! groups which prefix their subjects with
SH [Group title]. Obviously I use this prefix as one of the criteria for
SH sorting the emails into their respective folders.

You could also sort on the headers.  From the limited Yahoo Groups
lists I'm on, they seem to have a header, X-Apparently-To:, that you
could use.

SH Is there some way, using RegEx, that subsequent to moving to the
SH folder, I can rename the subject trimming the prefix (which includes a
SH trailing space after the ] ).

Not internally with TB.  The Bat does not allow for editing of
received messages*.  You could do it with an external script run from
your filters, but this method gets annoying to update when you change
your folder hierarchy in TB or in Windows.  Plus it requires knowledge
of some scripting/programming language.

If you do decide to write a script, you'd have to have a filter which
runs the script, passing it a copy of the message.  This filter should
also delete the original, or move it to a temp folder.  The script
itself can alter the message any way you please, but then it should
run TB with the /Import command-line option.  I'll let you figure out
the exact switches since they are well documented in the help file.

* That's not strictly true.  You can drag them to the outbox and edit
  them manually there, but this method destroys some header field values
  (ie date/time)

SH Also, would doing this affect any replies I made to these groups.

I doubt it.

-- 
Thanks for writing,
 Januk Aggarwal






 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: RegEx Template Help: Pruning/Deleting Duplicate Newlines

2003-02-19 Thread Januk Aggarwal
Hello Mike,

On Wednesday, February 19, 2003 at 5:23 PM, resistance was high, but
Mike Dillinger [MD] made current:

MD I'm trying to make a regex template to get rid of duplicate newlines.

Can you be more specific?  Perhaps an example would help. I don't
really understand where these new lines exist, and how many are you
trying to remove?  What is your final goal?  Maybe there is an easier or
at least preexisting solution.

MD Can anyone help me out?  I may not even be close.  Right now, it's not
MD doing anything.

You need to have capturing subpatterns for the text before and after
the region you want to remove.  In your example, adding (.*?)
(without quotes) and anchors (eg: ^ or $) before and after your pattern
would do the trick.  Of course, you haven't really specified what part
of the duplication you're trying to remove.  Right now, since you have
\n{2}, my suggestion above runs the risk of only deleting a single
blank line between paragraphs.  Is that what you want, or do you want
to delete all but one blank line between paragraphs?

Of course, everything I've said to this point will only work for *one*
deletion.  If you want to remove multiple instances, you'd need to
make your template quite long (each section needs it's own
subpattern), or use a recursive template scheme.

If I understand your objective, your best bet is to modify my wrap2
recursive template (see below for URL).  If you remove the %WRAPPED
from my engine, it will isolate paragraphs and allow you to control
how they are separated.

The URL is:
http://www.silverstones.com/thebat/Library.html#rewrap
Though, while testing, you'd probably want to use a driver template
more like Allie's:
http://www.silverstones.com/thebat/Library.html#rewrap+clipboard+content

I understand these recursive templates may look complex, so if you
give us some more info, I'd be happy to help you modify them
appropriately.

-- 
Thanks for writing,
 Januk Aggarwal

Was August Mobius so rigid that he could only see one side of a question?





 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html



Re: RegEx Template Help: Pruning/Deleting Duplicate Newlines

2003-02-19 Thread Januk Aggarwal
Hello Mike,

On Wednesday, February 19, 2003 at 9:13 PM, Mike Dillinger [MD]
pressed random keys until the following was produced:

MD I basically want to remove multiple blank/newlines from an email.

Ok, but you are aware that this solution will only work when you
*reply* to such a message, right?  There's nothing (internal) that we
can do for viewing these messages right now.

MD I'd like to get rid of all of the unnecessary newlines and just have one
MD newline between each section, like so:

That's what I thought.  In this case, do as I suggested and use the
wrap2 recursive engine.  You could use the form in the repository if
you want to wrap the other person's text.  If you want to preserve the
rest of the formatting, you would change the wrap2 template to look
like:

=[Begin wrap2]=
%IF:'%-
%SETPATTREGEXP=(?is-m)[^\n]+%-
%REGEXPMATCH=%COMMENT''':'%-
%-
%SETPATTREGEXP=(?is-m)^(.*?)(\n(((\w{0,5}(\\s*)+)?\s*\n))+(.*)\s*$|\z)%-
%-%-%-%-%-%REGEXPBLINDMATCH=%COMMENT%-
%-%-%-%-%-%SUBPATT=1

%COMMENT=_%SETPATTREGEXP=(?is-m)^(.*?)(\n(((\w{0,5}(\\s*)+)?\s*\n))+(.*)\s*$|\z)%-
%-%-%-%-%-%REGEXPBLINDMATCH=%COMMENT%-
%-%-%-%-%-%SUBPATT=7_%-
%QINCLUDE=wrap2'
=[ End  wrap2]=

Again, you need a driver template to run this one.  This one just
takes whatever is in the comment field, takes one paragraph at a time
from there and outputs it plus a blank line (thereby eliminating the
excess blank lines).

The driver template needs the following form:

%COMMENT=raw text%-
%QINCLUDE=wrap2%-
%COMMENT=

The last line is just to cleanup loose ends.  Good luck!

-- 
Thanks for writing,
 Januk Aggarwal





 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html



Re: Filter - Regexp writing to memo field

2003-01-22 Thread Januk Aggarwal
Hi Marck,

On Wednesday, January 22, 2003 at 02:52 GMT +, electricians were
shocked that Marck Pearlstone [MP] potentially scribbled:

MP I don't see any automatic import methods for AB data either - if
MP there were, that would do it.

The /import command will handle LDIF files perfectly well.  The
options are the same as /export.  See:
http://www.mail-archive.com/tbbeta@thebat.dutaint.com/msg15809.html

Of course, this doesn't make the rest much easier, but your suggestion
is currently feasible.

-- 
Thanks for writing,
 Januk Aggarwal

This almost blank page was intentional.



 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html



Re: Struggling with code

2003-01-01 Thread Januk Aggarwal
Hi Allie,

Wednesday, January 1, 2003 at 11:44 GMT -0500, was when inspiration
required Allie Martin to write:

 [...] from your interest in this sort of stuff it would
 appear that you need to join TBTECH. :)

Psst, the two of you both posted to TBTECH... ;-)

-- 
Thanks for writing,
 Januk Aggarwal

OK, I'm weird! But I'm saving up to become eccentric.



 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html



Re: Struggling with code

2003-01-01 Thread Januk Aggarwal
Hi Marck,

On Wednesday, January 1, 2003 at 17:05 GMT +, a stampede was
started when Marck Pearlstone [MP] hollered:

MP (.*?)  A recorded pattern consisting of any character (the
MPtarget for the extraction. Final '?' means may or may
MPnot be present.

A minor fix on this excellent breakdown.  The final ? in the bit above
makes the * repeat operator ungreedy.  For anyone who doesn't know,
without the ?, .* will match as much as it possibly can and still have
the rest of the expression work.  By making it ungreedy, .*? will
match the least it can and have the rest of the expression work.

An example:

=[Begin Sample Text]=
This is the first quote
This is a second quote
=[ End  Sample Text]=

Now suppose I want to extract the contents of the first quote above.
I might use an expression like:

%RegexpText='\.*\'

But this would match:

=[Begin Output 1]=
This is the first quote
This is a second quote
=[ End  Output 1]=

With the ungreedy option, the expression becomes:

%RegexpText='\.*?\'

Now the output is:

=[Begin Output 2]=
This is the first quote
=[ End  Output 2]=

If you run the above macros on this message, the results will be
slightly different in the first case.  It's a good illustration of
the difference between greedy and ungreedy.

-- 
Thanks for writing,
 Januk Aggarwal

Ok, who is General Relativity, and what did he do with Sir Newton?



 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html



Re: Struggling with code

2002-12-31 Thread Januk Aggarwal
Hello Ken,

On Tuesday, December 31, 2002 at 8:37 AM, a witness saw Ken  Marilyn
[KM] type:

KM register_a_friend: Register A Friend
KM friends_name: Patti
KM friends_email: [EMAIL PROTECTED]
KM your_name: Sunny
KM your_email_address: [EMAIL PROTECTED]
KM Submit: Submit

KM What I want is a Quick Template that puts the friends_email into the
KM TO: box, the friends_name in the body after Hi * and the
KM referrers name your_name in the body.

You need regular expressions.  They aren't hard, but they do have a
steep learning curve.

To extract the friend's name, use:
   %RegExpText=(?im-s)^\s*friends_name:\s*(.*?)\s*\n%-

Simillarly, friends_email can be retrieved with:
   %RegExpText=(?im-s)^\s*friends_email:\s*(.*?)\s*\n%-

And for your_name:
   %RegExpText=(?im-s)^\s*your_name:\s*(.*?)\s*\n%-

KM It should look something like this.
snip

So your final template would look something like:

=[Begin Template]=
Hi %RegExpText=(?im-s)^\s*friends_name:\s*(.*?)\s*\n,

A friend of yours, %RegExpText=(?im-s)^\s*your_name:\s*(.*?)\s*\n,
thought you'd like to receive our newsletter...

%To=''%To='%RegExpText=(?im-s)^\s*friends_email:\s*(.*?)\s*\n'
=[ End  Template]=

Note: If you are in the process of learning regular expressions and
  how to use them in TB, I've used a shortcut with the %RegexpText
  macro.  The expressions above are fairly simple, so such
  shorcuts are justified.

-- 
Thanks for writing,
 Januk Aggarwal

With these words, this page is no longer blank but is complete.



 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html



Re: macro to change from: field dynamically to original messages to:field

2002-12-26 Thread Januk Aggarwal
Hello Victor,

On Thursday, December 26, 2002 at 07:10 GMT -0500, legend has it that
Victor B. Gonzalez recited the incantation:

MDP Yes - change your reply template. Just add this line to any reply
MDP template you need to give this ability to:
snip
MDP %from='%OTONAME %OTOADDR'%-
snip
 I've learned two things today. What I asked for and a bonus
 of %OTONAME thanks to you Marck.

There is one potential problem with the template as written.  If you
use this template when replying to a message where you are not the
first recipient listed, your reply might look like it came from
someone else.

This is easy to fix with a bit of regular expression trickery, though
the exact solution could depend on how your mail servers are setup.
Probably the easiest is something like:

%From='Victor B. Gonzalez %-
%SetPattRegExp=(?i)(%-
[EMAIL PROTECTED]|[EMAIL PROTECTED]%-
)%RegExpMatch=%OToList %OCcList'

I've just formatted the above so it is a bit easier to read and edit
your addresses.  You can choose from as many addresses you want, just
add them before the %- at the end of the line.  Remember to separate
each address with a pipe symbol (|).

Note that for now I hard coded your name into the macro above.  For
the more general case, finding your name in the original message isn't
trivial since there could be unknown variations.

-- 
Thanks for writing,
 Januk Aggarwal

If you've ever noticed, the average traffic cone queue stretches for
miles, and the poor things often wait for hours without progressing 
anywhere. Traffic cones have rights, just like people.



 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html



Re: Number of members

2002-12-07 Thread Januk Aggarwal
Hello Britt,

It was foretold that on Saturday, December 7, 2002 at 14:37 GMT +0100,
Britt Malka [BM] would type:

BM Is it possible to write the number of members in a certain group in
BM the address book with the help of reg.expr. or macros?

The only way I can think of doing this is using a recursive template
to count the number of entries in the To, CC or BCC fields.  However,
this won't work if you use the Mass Mailing feature as Gerd suggested,
plus it may give inaccurate results if some people are listed
multiple times.

Your best bet may be to use some sort of external counting program to
generate a text file with the info so you can use %PUT in your
template.  I don't know how you handle Subscription/Unsubscription
requests, so I can't suggest simple filters to automate the task at
this time.

If you can tell us a little more about how your specific list setup
works (or how you plan for it to work), then more tailored solutions
may be available.

-- 
Thanks for writing,
 Januk Aggarwal

All science is either physics or stamp collecting.
-- E. Rutherford



 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html



Re: Automatic time zone change in the spring and fall

2002-11-23 Thread Januk Aggarwal
It was Monday, November 18, 2002 at 10:33 PM, when I [JA] wrote:

JA I've found a very general way to calculate your offset using three
JA QT's. (Unfortunately, I haven't included half hour timezones).

For anyone who was following this thread, the time zone template has
been much improved and can be found at:
http://www.silverstones.com/thebat/Library.html#gmt+offset

-- 
Thanks for writing,
 Januk Aggarwal

People are more violently opposed to fur than leather because it's 
safer to harass rich women than motorcycle gangs.



 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html



Re: Automatic time zone change in the spring and fall

2002-11-18 Thread Januk Aggarwal
Hi Daniel

You wrote:

 I think that if we calculate/read the message's GMT hour, we can only be
 off by 0 hours, + 24 hours, or -24 hours, because GMT is GMT no matter
 which side of the International Date Line the message was sent from.

That is correct, but determining which is the case without knowing your 
local offset is not trivial in TB.  I have to think about how to implement 
this, but the best way seems to be to look at the relative day of week.  If 
my day is the same as the correspondent, no problem.  If my day is behind 
the correspondent, my offset is 24 hours too high.  If my day is ahead of 
the correspondent, my offset is 24 hours too low.

 I infer that there are only twelve (a very finite number) of possible
 offsets:

Yes, but it is actually easier than you have listed.  The whole point is 
that this template system should be able to handle the job on its own, with 
no prior knowledge about your timezone.  That's where things get tricky.

 Windows knows (or has calculated) whether to keep Daylight or
 Standard Time. Can Window's brain be picked?

I've tried to access this through scripts, and it doesn't appear to be 
easy.  Unless Windows stores the information in a plain text file (INI or 
something), you would need to create some sort of script that would update 
a file that TB can access once a day or so.  This isn't ideal in general.

If Windows does keep the information in some common INI file, then we're in 
business.  Pulling out the information would be almost trivial with an 
appropriate regexp.

Unfortunately I don't have time these days to dig through my Windows 
configuration files.  If someone knows where this info is stored, your help 
would be much appreciated.

Thanks,
Januk Aggarwal



 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html



Re: Automatic time zone change in the spring and fall

2002-11-18 Thread Januk Aggarwal
Hi Daniel,

You wrote:

 I decided to test TZOffset, by QINCLUDEing TZOffset in my original reply
 template instead of QINCLUDEing TZSelect there. Sure enough, TZOffset
 yielded -29. After some thought, I realized that for a few hours each
 day, GMT's day is Eastern (Standard/Daylight) Time's tomorrow. Since
 midnight is 00 hours, 1 AM is 01 hours, ..., TZOffset yields a
 difference that's off by 24 hours, during the time when GMT day is ahead
 of Eastern (Standard/Daylight) Time. As a result, there are four (NOT
 two) possible differences that TZOffset can yield:

You forgot a case.  See below.
 

 Fortunately for me, TZSelect was just an IF, THEN, ELSE statement in
 disguise grin, 

Yes, but your template needs a slight modification:

=[Begin TZSelect QT]=
%IF:%QInclude='TZOffset'=-5:EST%-
%IF:%QInclude='TZOffset'=-4:EDT%-
%IF:%QInclude='TZOffset'=-29:EST%-
%IF:%QInclude='TZOffset'=-28:EDT%-
%IF:%QInclude='TZOffset'=19:EST%-
%IF:%QInclude='TZOffset'=20:EDT%-
=[End TZSelect QT]=

The case you forgot is when you're still on one day, but your correspondent 
is on the next day.  Of course this case by case modification works, the 
only trouble is that it isn't general, ie it is only good for one timezone.

The more general solution will take some more thought, but at least now you 
have a template that should work well for you.

 Januk, thank you again for your help. Particularly, thank you for making
 me think.

I'm glad I could help.

Januk Aggarwal



 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html



Re: Local name of day, when different from replied-to message's nameof day, template.

2002-11-18 Thread Januk Aggarwal
Hi Daniel,

On Monday, November 18, 2002 at 11:02 GMT -0500, clairvoyants were
mystified when Daniel Grunberg [DG] conjured:

DG If and only if the message's day is different from my local day,
DG I'd like to include my day in the you wrote line above the
DG quote.

Use something like:

=[Begin IncludeDay QT]=
%If:%-
%SetPattRegExp='(?im-s)^Date:.*?(Sun|Mon|Tue|Wed|Thu|Fri|Sat)'%-
%RegExpMatch='%Headers'%ODate='ddd': %ODate='ddd'%-
=[ End  IncludeDay QT]=

-- 
Thanks for writing,
 Januk Aggarwal

I have an imaginary friend who refuses to play with me.



 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html



Re: Automatic time zone change in the spring and fall

2002-11-17 Thread Januk Aggarwal
Hello Januk,

It was Saturday, November 16, 2002 at 11:47 PM, when I [JA] wrote:

JA Yes, use the following to compute your timezone offset:
snip
JA The TZOffset QT seems to work on all sample messages here, but your
JA mileage may vary.

Unfortunately this fails when the two timezones (yours and your
correspondent) happen to be on different days at the time the original
message was sent.  The general fix is not trivial with TB.  I can give
you an error-prone fix right now, but the general fix is still
elusive.

-- 
Thanks for writing,
 Januk Aggarwal

Personal Plan:  To avoid sanity, lucidity and wit at all costs.



 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html



Re: Automatic time zone change in the spring and fall

2002-11-16 Thread Januk Aggarwal
Hello Daniel,

On Saturday, November 16, 2002 at 11:39 GMT -0500, legend has it that
Daniel Grunberg [DG] recited the incantation:

DG Is there a way I can fix my template, so that EST or EDT will be
DG given in the quote, in automatic accordance with my system time?

DG I have no idea of how to do it, but I thought that I might want to:
DG   1. Compute (or get) the original message's GMT hour.
DG   2. Compute the difference between the message's GMT hour and the
DG  %OTIME hour.
DG   3. If the difference is 5 hours, EST will be used.
DG   4. If the difference is not 5 hours EDT will be used.

Yes, use the following to compute your timezone offset:

=[Begin TZOffset QT]=
%Calc='%-
%SETPATTREGEXP=(?im-s)%-
%-%-^Date\:.*?\s(\d{0,2})\:\d{0,2}\:\d{0,2}\s.*?([-+]\d{2})\d{2}%-
%REGEXPBLINDMATCH=%HEADERS%-
%OTIME=hh - (%SUBPATT=1 - (%SUBPATT=2))'%-
=[ End  TZOffset QT]=

Then replace your EST with:

=[Begin TZSelect QT]=
%IF:%QInclude='TZOffset'=-5:EST:EDT%-
=[ End  TZSelect QT]=

The TZOffset QT seems to work on all sample messages here, but your
mileage may vary.

-- 
Thanks for writing,
 Januk Aggarwal

I should probably engage that largish, grey organ lurking inside of
my skull a bit more often. I think it's called a brain.
-- Simon



 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html



Re: TO address in templates

2002-11-04 Thread Januk Aggarwal
Hello Marcus,

On Monday, November 4, 2002 at 00:43 GMT +0100, resistance was high,
but Marcus [M] made current:

M That's odd, I had tried that. The clear does not work at all, and
M the first word on the next line, Dear in this case, is
M omitted.

Just put the %CLEAR macro at the end of your template (or somewhere
where the extra space doesn't matter).  TB is smart enough to figure
out that you don't want to clear the stuff in the same template.

-- 
Thanks for writing,
 Januk Aggarwal

Personal Plan:  To avoid sanity, lucidity and wit at all costs.



 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html



Re: Filters: running external programs

2002-10-22 Thread Januk Aggarwal
Hello Kjartan,

On Tuesday, October 22, 2002 at 13:33 GMT +0200, electricians were
shocked that Kjartan Mannes [KM] potentially scribbled:

 No... My dirty workaround is Save to text-file using template, modify
 file (Unix-mailbox), import back, kill original

KM Drats. Oh well, I can always do it on the mail server. Thanks.

Well, you can have your filter delete the original, run a batch file
that runs your program, then imports the modified message back into
TB.  See the command line parameter help in the help file for more
information.

-- 
Thanks for writing,
 Januk Aggarwal



 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html



Re: Regular expression for missing macro

2002-10-21 Thread Januk Aggarwal
Hi Marek,

You wrote:

  There is a macro %TEXT=n, which inputs only first n rows of  original
 message, in this case first six. Problem is in missing  macro, which
 will input the rest of original message - from
  row 7 to end.
 
  Is somehow possible to do it with reg. expressions? They need
 following:

I think so, try:

%SETPATTREGEXP='(?s-m)^%Text=n(.*)$'%-
%REGEXPMATCH='%TEXT'%-

Note I'm not on TB at the moment, so this is untested.

-- 
Have fun,
Januk




 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html



Re: Problems with wrapping in QT

2002-09-18 Thread Januk Aggarwal

Hello Alinda,

On Thursday, September 19, 2002 at 04:17 GMT +0200, earthworms were
entertained when Alinda Helleman [AH] exposed:

AH I thought the following QT should do the trick.

AH ,--- [ QT wrappedcookie ] ---
AH | %SETPATTREGEXP=^(.*)-/-(.*)$%-
AH | %REGEXPBLINDMATCH=%QINCLUDE='pickcookie'%-
AH | %WRAPPED=%SUBPATT='1'
AH | %SUBPATT=2%-
AH `

The problem you're noticing is not a bug, it is due to how the macros
are processed.  The argument to a macro can be thought of as a
mini-template, and regular expressions are not inherited from a parent
template.  What do I mean?

Well, you defined your regular expression at the QT level, but you're
calling %SUBPATT=1 inside the mini-template of %WRAPPED.  But you
didn't define a regular expression in the mini-template, so the
subpattern is empty.

To get around the issue, you need to define the regular expression
in both places.  But you are using a QT to randomly choose your
cookie, so you should use the %COMMENT field to store the result of
your picking the cookie.  The template would look something like:

=[Begin wrappedcookie]=
%COMMENT=%QINCLUDE='pickcookie'%-
%-
%WRAPPED='%-
%SETPATTREGEXP=^(.*)-/-(.*)$%-
%REGEXPBLINDMATCH=%COMMENT%-
%SUBPATT=1'
%-
%SETPATTREGEXP=^(.*)-/-(.*)$%-
%REGEXPBLINDMATCH=%COMMENT%-
%SUBPATT=2
%-
%COMMENT=%-
=[ End  wrappedcookie]=

-- 
Thanks for writing,
 Januk Aggarwal

All science is either physics or stamp collecting.
-- E. Rutherford



 Current version is 1.61 | Using TBTECH information:
http://www.silverstones.com/thebat/TBUDLInfo.html



Re: too many blank lines in 'wq'

2002-08-22 Thread Januk Aggarwal

On Wednesday, August 21, 2002 at 7:53 PM, it was me, Januk Aggarwal
[JA] who wrote:

JA If that's the case, then you can use an updated version of wrap2.
snip

In my testing I noticed that the wrap2 template fails when a
paragraph separating line contains only white space characters.

I've seemingly fixed it with the following template, but I fear that I
may have made the regexps a little too general.  I didn't have any
text that failed, but my test sets are somewhat limited.  I'd
appreciate some feedback on how well this fix worked.

=[Begin wrap2]=
%IF:'%-
%SETPATTREGEXP=(?is-m)[^\n]+%-
%REGEXPMATCH=%COMMENT''':'%-
%-
%WRAPPED=_%SETPATTREGEXP=(?is-m)^(.*?)(\n(((\w{0,5}(\\s*)+)?\s*\n))+(.*)\s*$|\z)%-
%-%-%-%-%-%REGEXPBLINDMATCH=%COMMENT%-
%-%-%-%-%-%SUBPATT=1_

%COMMENT=_%SETPATTREGEXP=(?is-m)^(.*?)(\n(((\w{0,5}(\\s*)+)?\s*\n))+(.*)\s*$|\z)%-
%-%-%-%-%-%REGEXPBLINDMATCH=%COMMENT%-
%-%-%-%-%-%SUBPATT=7_%-
%QINCLUDE=wrap2'
=[ End  wrap2]=


-- 
Thanks,
 Januk Aggarwal

This page intentionally left unblank.


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: %CCLIST revisited

2002-08-22 Thread Januk Aggarwal

On Monday, June 24, 2002 at 3:41 AM, I, Januk Aggarwal [JA] presumed
to write:

JA here is the current version which lists an arbitrary number of
JA recipients.

Offlist, a list member drew my attention to some problems with the
recipient2 template and names with commas in them:
(ie LastName, Firstname [EMAIL PROTECTED])

Here is the updated template:

=[Begin recipient2]=
%REM='
  Recipient List reformating routine.
  recipient2 = recursive engine QT
  
  Written by Januk Aggarwal
  June 2002
  Update: August 2002
'%-
%-
%IF:'%-
%SETPATTREGEXP=$(?i)^((\?)(.*?)\2\s*(.*?)?\s*[;,]\s*)?$%-
%REGEXPMATCH=$%COMMENT$''':'%-
%-
%SETPATTREGEXP=$(?i)^((\?)(.*?)\2\s*(.*?)?\s*[;,]\s*)?$%-
%REGEXPBLINDMATCH=$%COMMENT$%-
%SUBPATT=$3$ %-
%SUBPATT=$4$
%-
%COMMENT=_%-
%-%-%SETPATTREGEXP=$(?i)^((\?)(.*?)\2\s*(.*?)?\s*[;,]\s*)?(.*)$%-
%-%-%REGEXPBLINDMATCH=$%COMMENT$%-
%-%-%SUBPATT=$5$_%-
%-
%QINCLUDE=recipient2'%-
=[ End  recipient2]=

-- 
Thanks for writing,
 Januk Aggarwal

Despite these words, this page is blank.


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: too many blank lines in 'wq'

2002-08-21 Thread Januk Aggarwal

Hello Robert,

On Wednesday, August 21, 2002 at 21:47 GMT -0400, special agents were
informed that Robert  D. [RD] leaked:

RD What else could I do to cut the blank lines?

Until you post the exact versions you're using, we can't do much to
help.  You don't say what the wq template is supposed to do.  I assume
you mean the wrap macro which is posted on Marck's macro site?

If that's the case, then you can use an updated version of wrap2.

=[Begin wrap2]=
%IF:'%-
%SETPATTREGEXP=(?is-m)[^\n]+%-
%REGEXPMATCH=%COMMENT''':'%-
%-
%WRAPPED=_%SETPATTREGEXP=(?is-m)^(.*?)(\n((\w{0,5}(\\s*)+)?\n)+(.*?)\s*$|\z)%-
%-%-%-%-%-%REGEXPBLINDMATCH=%COMMENT%-
%-%-%-%-%-%SUBPATT=1_

%COMMENT=_%SETPATTREGEXP=(?is-m)^.*?(\n((\w{0,5}(\\s*)+)?\n)+(.*?)\s*$|\z)%-
%-%-%-%-%-%REGEXPBLINDMATCH=%COMMENT%-
%-%-%-%-%-%SUBPATT=5_%-
%QINCLUDE=wrap2'
=[ End  wrap2]=

If that doesn't do the trick, then you can always use a new wq
template:

=[Begin wq]=
%COMMENT=%QUOTES%-
%SETPATTREGEXP='(?s-m)^(.*?)\s*$'%-
%REGEXPMATCH='%QINCLUDE=wrap2'%-
%COMMENT=
=[ End  wq]=

-- 
Thanks for writing,
 Januk Aggarwal

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]




Re: Macro's site?

2002-08-12 Thread Januk Aggarwal

Hi Marck,

It was foretold that on Monday, August 12, 2002 at 09:40 GMT +0100,
Marck Pearlstone [MP] would type:

MP For now I'm leaving edit and removal as an administrative
MP function.

That's probably smart.

B also maybe there should be some example of input/output of those
B QTs...

MP It's pretty simple - just fill in the form. shrug

From my point of view, it would be nice to keep the macro library
dedicated to listing the macros.  I would think that the lists and the
archives are better suited for filling in *all* the gory details.

Though I suppose a reference to the appropriate archive message(s) might
not be a bad idea.  As you say though, that should be done in the body
of the form.

-- 
Thanks for writing,
 Januk Aggarwal

With these words, this page is no longer blank but is complete.


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: can I filter messages where I am a cc: recipient

2002-08-12 Thread Januk Aggarwal

Hi Allie,

Monday, August 12, 2002 at 05:32 GMT -0500, was when inspiration
required Allie Martin to write:

 I don't see why

 (?ims)^CC:.*[EMAIL PROTECTED]

 shouldn't work.

Just be slightly careful. Yours will match if Dwight's address appears
*anywhere* in the headers after the CC line. That includes the To: or
From: or any other header (however rare that might be.)

A more restricted regexp would look something like:

(?im-s)^CC:.*?(\n\s.*)*([EMAIL PROTECTED])

-- 
Thanks for writing,
 Januk Aggarwal

Despite these words, this page is blank.


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: Macro's site?

2002-08-10 Thread Januk Aggarwal

Hi Marck,

On Friday, August 9, 2002 at 18:01 GMT +0100, legend has it that Marck
Pearlstone [MP] recited the incantation:

B I think, you should add author of QT in form.

MP Done. And time / date added.

Marck, the site looks very good.  Just a suggestion, perhaps there
should be two fields, author and poster?  The author doesn't always
find the macro as useful as the poster.

-- 
Thanks for writing,
 Januk Aggarwal

People are more violently opposed to fur than leather because it's
safer to harass rich women than motorcycle gangs.


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: Regex to grab specific text from message

2002-07-31 Thread Januk Aggarwal

Hello Blarp,

On Tuesday, July 30, 2002 at 11:35 PM, a beagle known as Blarp [B]
barked:

B (?i-s) = Turn on caseless, turn off dot matching newline.
B \s = any whitespace character
B From:
B \s = any whitespace char

Yes.

B *\ = 0 or 1  chars

Nope.  The * works on the previous \s.  It says 0 or more white space
characters and 1  character.

B (.*?) = 0 or 1 instances of anything

Nope.  It is the fewest number of 0 or more of any character.

B \ = must have 

Right.

B From: Vinnie [EMAIL PROTECTED] or
B From: Vinnie Smith [EMAIL PROTECTED] or
B From: Vinnie [EMAIL PROTECTED]
B From: Vincent Q. Smith [EMAIL PROTECTED]

For the name, try:
%REGEXPTEXT='(?im-s)^From:\s*\?(.*?)\?\s*\'

You can try the following for the other regexp.
%REGEXPTEXT='(?im-s)^From:.*?\(.*?)\'

-- 
Thanks for writing,
 Januk Aggarwal

I've determined the momentum of my physics assignment so precisely
that it can be anywhere in the universe right now.


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: wrapped boxquoting

2002-07-15 Thread Januk Aggarwal

Hello Aza,

It was foretold that on Monday, July 15, 2002 at 14:23 GMT +0700, Aza
Lsaja [AL] would type:

AL I just copy the wrap2 and begin QT, but it's hanged my tb when
AL I execute it.

The wrap2 and bq2 templates are recursive templates.  TB didn't
support recursive templates before the 1.6x series, as the template
processing engine has changed significantly.

In TB v1.5x, both the true and false mini-templates of the %IF macro
would be executed before choosing which one to use.  Because the true
mini-template calls the recursive template again, you get stuck in an
infinite loop and have to kill TB from the task manager.

The moral is, do ***NOT*** use these templates in versions 1.5x and
lower.  If you really want them, upgrade your TB installation to the
latest version.

If you do upgrade, you'll also need Carsten's boxquoting templates.
They can be found in the TBTECH archive at:
http://www.mail-archive.com/tbtech@thebat.dutaint.com/msg01200.html

-- 
Thanks for writing,
 Januk Aggarwal

His nerves. His memory. And I can't remember the third thing.
   -Lee Trevino on the three things that go as a golfer ages.


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: bat - commandline - sending messages to group

2002-07-15 Thread Januk Aggarwal

Hello Brano,

On Monday, July 15, 2002 at 15:02 GMT +0200, Brano [B] heard voices
say:

B C:\Program Files\The Bat!\TheBat.EXE /MAILU=2ge;TO=slovenske 
list;S=test;TEXT=C:\mysql\bin\mail.txt

Change the /Mail part to:

/MAILU=2ge;TO=slovenske list;S=test;TEXT=C:\mysql\bin\mail.txt


-- 
Thanks for writing,
 Januk Aggarwal


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: Attribution Line in Replies and Forwarded Messages etc.

2002-07-14 Thread Januk Aggarwal

On Sunday, July 14, 2002 at 1:21 PM, earthworms were entertained when
Januk Aggarwal [JA] exposed:

JA Yes.

Er, sorry.  Hit the wrong button by mistake.  See my next message for
the full response.

-- 
Thanks for writing,
 Januk Aggarwal

I tried relaxing, but...I don't know...I feel more comfortable tense.


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: Attribution Line in Replies and Forwarded Messages etc.

2002-07-14 Thread Januk Aggarwal

Hello Chris,

On Sunday, July 14, 2002 at 11:38 GMT +0100, Chris Weaven [CW] heard
voices say:

CW when I write back to someone in the same timezone, this bit 'my local
CW time, Januk Aggarwal' seems to add an extra space between the comma and
CW your first name. Do you know why?

Yes.  Change these two.

- [ Begin Attribution ] -
%wrapped=#On %QINCLUDE=Date %QINCLUDE=Time
%QINCLUDE=MyTimeZone local time,
%QINCLUDE=TimeZoneCheck%QINCLUDE='InitSelect' wrote;
%QINCLUDE=QuotesInit#
- [  End  Attribution ] -

- [ Begin TimeZoneCheck ] -
%IF:'%QINCLUDE=Time''%ODATE=hh:nn':'%-
which was %QINCLUDE=OtherDate my local time, ':''%-
- [  End  TimeZoneCheck ] -

CW Thanks for you help Januk!

You're welcome.


-- 
Thanks for writing,
 Januk Aggarwal

I have an imaginary friend who refuses to play with me.


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: Request, Quoter, Take out Dear ****,

2002-07-14 Thread Januk Aggarwal

Hello John,

On Friday, July 12, 2002 at 9:24 AM, something compelled John Thomas
[JT] to type:

JT I would like [...] to take out the Dear|Hello FName,|: or FName,|:
JT and the blank line following it.

Try:

 [ Begin ] 
%QUOTES='%SETPATTREGEXP=(?is)%-
((\s*)?\n?-BEGIN PGP SIGNED.*?\n(Hash:.*?\n)?\s*)?%-
(--+\s+.*roups.*~--\\n.*\n--+~-\\n\n)?%-
(\s*(Dear|Hello|Hi).*?\n+)?%-
(.*?)(^(%-
- -*?\s*?--\s*\n|%-
_{40,}\s*\n|%-
-{40,}\s*\n|%-
\n-BEGIN PGP SIGNATURE.*s?\n|%-
--+\s+.*roups.*~--\)|%-
\n\nYour use of|%-
\n+Get your FREE download|%-
\nNote that the email address of the sender has been changed|%-
\n---\nOutgoing mail is certified Virus Free.|%-
\z)%REGEXPBLINDMATCH=%text%SUBPATT=7'%-
 [  End  ] 

-- 
Thanks for writing,
 Januk Aggarwal

Ok, who is General Relativity, and what did he do with Sir Newton?


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: wrapped boxquoting

2002-07-13 Thread Januk Aggarwal

Hello Sudip,

On Saturday, July 13, 2002 at 14:45 GMT +0530, Sudip Pokhrel [SP]
heard voices say:

SP This works except for one problem, please see my examples below:
snip
SP | The empty space increases proportionally with the number of paragraphs

I can't really reproduce the problem.  All I get is 1 extra empty
line from wrap2, but that is taken care of by the template I gave you
previously.  So I'm not sure where the problem is being introduced in
your template system.  I imagine it must be from wrap2, so you could
try the following template.  However, I would check first if you
haven't miscopied the wrap2 template I referred to previously.

[Begin wrap2]
%IF:'%-
%SETPATTREGEXP=(?is-m)[^\n]+%-
%REGEXPMATCH=%COMMENT''':'%-
%-
%WRAPPED=_%SETPATTREGEXP=(?is-m)^(.*?)(\n((\w{0,5}(\\s*)+)?\n){1,}(.*)$|\z)%-
%-%-%-%-%-%REGEXPBLINDMATCH=%COMMENT%-
%-%-%-%-%-%SUBPATT=1_
%-
%COMMENT=_%SETPATTREGEXP=(?is-m)^.*?(\n((\w{0,5}(\\s*)+)?\n){1,}(.*)\s*$|\z)%-
%-%-%-%-%-%REGEXPBLINDMATCH=%COMMENT%-
%-%-%-%-%-%SUBPATT=5_
%-
%QINCLUDE=wrap2'
[ End  wrap2]


-- 
Thanks for writing,
 Januk Aggarwal

Is it OK to use the AM radio after noon?


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: Attribution Line in Replies and Forwarded Messages etc.

2002-07-11 Thread Januk Aggarwal

Hello Chris,

On Thursday, July 11, 2002 at 21:34 GMT +0100, Chris Weaven [CW] heard
voices say:

CW It only seems to work when I write to you, or it could be the fact
CW that it's a different date?

I'm not sure.  There have been so many changes to your template, I can
no longer make heads or tails of what you have.  Can you please post
the parts of your template system which are responsible for including
the where I am part.

CW I am using the correct template. I've checked a couple of times
CW now.

Ok, then I really don't know the problem.  Please include *all* of the
parts of your templates which affect the attribution line.

CW The only other thing I wanted to work on was, if they're in the same
CW time zone, I wanted it to say in 'our' time zone, rather than in 'your'
CW time zone.

Ok, but that can be done as part of the streamlining of your current
templates.

CW Apologies for being thick still, but your help is really
CW appreciated

No problem.

CW and I think once I've got this sorted, I'll be kept quiet for a
CW bit!?

Why?  Won't you want to use your new template system as much as
possible? ;-)


-- 
Thanks for writing,
 Januk Aggarwal

If you've ever noticed, the average traffic cone queue stretches for
miles, and the poor things often wait for hours without progressing
anywhere. Traffic cones have rights, just like people.


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: Attribution Line in Replies and Forwarded Messages etc.

2002-07-02 Thread Januk Aggarwal

Hello Chris,

An archeological dig discovered that on Tuesday, July 2, 2002 at 08:29
GMT +0100, Chris Weaven [CW] typed the following:

CW When I press the reply button, no text from your mail is carried
CW over. Here is my template;

CW On %QINCLUDE=Date %QINCLUDE=Time, which was %ODATE=, %-
CW  d,  at hh:nn where I am, %OFROMFNAME %OFROMLNAME 
[%QINCLUDE='Initials'] wrote;
CW %Quotestyle= %QINCLUDE=QuotesInit

Delete this.  You already have the %QUOTESTYLE macro in your
QuotesInit QT.  All you need in your main template is the
%QInclude=... part.

The technical problem is, you need to use a delimiter around the
argument. In other words, it should be:
%QuoteStyle='%QINCLUDE=QuotesInit'

While it is true that this version allows you to use almost any
character as a delimiter, spaces won't usually work simply because
spaces at the end of a line will be stripped by the editor. When TB
doesn't see that second space, it thinks the rest of your template is
part of the argument to %QuoteStyle. In other words, it causes major
confusion.

CW Also, I like the attribution line because the text was written on
CW different days because of the time difference, but if there was no
CW time difference, I'd like to line to only show the time for my bit
CW rather than the whole day. I'm sure we'll need an if function in
CW there somewhere!?

Yes.  The easiest is to replace the whole %ODATE='...' bit with:
%IF:'%QINCLUDE=Time'='%ODATE=hh:nn':'%-
%ODATE=hh:nn':'%-
%ODATE=,  d,  at hh:nn%-

CW Yup. I carried them all over, but something still seems very wrong

I don't follow, what is wrong?  Your attribution line seemed to come up
with the initials ok.

-- 
Thanks for writing,
 Januk Aggarwal

Was August Mobius so rigid that he could only see one side of a question?


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: Attribution Line in Replies and Forwarded Messages etc.

2002-07-02 Thread Januk Aggarwal

Hello Chris,

On Tuesday, July 2, 2002 at 19:07 GMT +0100, an infinite number of
monkeys posting as Chris Weaven [CW] typed:

CW This was almost what I wanted, but I worded it incorrectly. I
CW wanted it to show the full date and time if the actual date was
CW different rather than the time. Does that make sense? As you can
CW see above, it's got a repeat of the date, whereas I only wanted it
CW to show the date if it was different due to the different
CW time-zones.

Ah, that makes a little more sense.  Try:

%IF:'%SETPATTREGEXP=(?im-s)^Date\:.*?\,\s*(\d*)%-
%REGEXPMATCH=%HEADERS%-'='%ODATE=d':'%-
%ODATE=hh:nn':'%-
%ODATE=,  d,  at hh:nn%-

CW You assistance and patience is greatly appreciated!

You are welcome.

-- 
Thanks for writing,
 Januk Aggarwal

There is no such place as the University of Wis-cosine, and if there
was, the motto of their mathematics department would not be 
Secant ye shall find.


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: Regexp needed - \n\n problem

2002-07-01 Thread Januk Aggarwal

Hello Brano,

It was Thursday, June 27, 2002 at 17:03 GMT +0200, when Brano [B]
wrote:

B yes, this is exactly what I want. If there is no paragraph in the
B first 5 lines, it should pick whole message.

This seems to work:
%SETPATTREGEXP=(?is-m)^((([^\n]*)\n){0,5}?\s*\n)?(.*)$%-
%REGEXPBLINDMATCH=%TEXT%-
%SUBPATT=4

Note, if you want all paragraphs in the first 5 lines removed, make
the regexp:
(?is-m)^((([^\n]*)\n){0,5}\s*\n)?(.*)$

-- 
Thanks for writing,
 Januk Aggarwal

Reality is merely an illusion, albeit a very persistent one.
  --Albert Einstein (1879-1955)


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: Attribution Line in Replies and Forwarded Messages etc.

2002-07-01 Thread Januk Aggarwal

Hello Chris,

An archeological dig discovered that on Monday, July 1, 2002 at 18:27
GMT +0100, Chris Weaven [CW] typed the following:

CW On Monday, July 1, 2002 01:28, which was Monday, July 1, 2002 at
CW 09:28 where I am, Januk Aggarwal [JA] wrote;
snip
CW As you can see by the above, I now have your initials present on
CW the attribution line. Yippee

Congrats.

CW But, I seem to have broken everything else :-(

I don't really see what is broken.  If you mean that you don't have
the initials in the quotes, then you can use a QuoteStyle macro like:

%QUOTESTYLE='%-
%IF:%-
%SETPATTREGEXP=(?im-s)^X-Mailer\:.*(Bat!|Becky|Gnus|slrn).*$%-
%REGEXPBLINDMATCH=%HEADERS%-
%SUBPATT=1:=%QINCLUDE=Initials:None'

Just remember to put this somewhere before your %QUOTES macro.

CW I copied over the template from your link, where you have a series
CW of 3 QT's. Can you give me a hint of how they all link together as
CW I had to copy and paste your mail to get this info across! :-(

You mean the Initials, Full Name and Full Name - No AB Entry QTs?
That's fairly simple.  The Initials routine needs a string from which
it will extract the initials.  That string is generated by the Full
Name QT which looks in the address book.  If there isn't an address
book entry then the Full Name QT calls the Full Name - No AB Entry QT
to make sure that the name of the person is returned.  If %OFROMNAME
macro returns an address, only the part before the '@' is returned.

CW I totally agree with you. Although I'm getting frustrated, I get a
CW good sense of achievement on completion (should I ever get there!)

You will, soon.

-- 
Thanks for writing,
 Januk Aggarwal

Was August Mobius so rigid that he could only see one side of a question?


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: Attribution Line in Replies and Forwarded Messages etc.

2002-06-30 Thread Januk Aggarwal

Hello Chris,

On Sunday, June 30, 2002 at 12:01 GMT +0100, aliens probed Chris
Weaven [CW] and found:

CW Hi Januk,


On %QINCLUDE=Date %QINCLUDE=Time2, which was %ODATE=, %-
 d,  at hh:nn where I am, %OFROMFNAME %OFROMLNAME %QINCLUDE=Qstyle 
wrote;

CW I'd like to add in the initials of the writer after the name, but
CW only if their client accepts it. Is this possible?

Yes, use this fragment to give attribution line initials or nothing
depending on the client:

%IF:%SETPATTREGEXP=(?im-s)^X-Mailer\:.*(Bat!|Becky|Gnus|slrn).*$%-
REGEXPBLINDMATCH=%HEADERS%-
%SUBPATT=1:[%QINCLUDE='Initials']

Where Initials is the name of the initials generation template you
use.  There are two in current circulation with recent threads in both
TBTECH and TBUDL giving reference to them.

CW As you can see, I already have it in the reply template, but it
CW doesn't seem to work?

What you posted was a code fragment that was poorly formatted.  If
that's the way it was in your template, then it would cause problems.
If the formatting was simply an error when copying and pasting, then
we'd need to take a closer look at the templates.

-- 
Thanks for writing,
 Januk Aggarwal

OK, I'm weird! But I'm saving up to become eccentric.


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: Attribution Line in Replies and Forwarded Messages etc.

2002-06-29 Thread Januk Aggarwal

Hello Chris,

On Saturday, June 29, 2002 at 22:41 GMT +0100, an infinite number of
monkeys posting as Chris Weaven [CW] typed:

CW So, this is what I'd like (in an ideal world):

It looks like you're pretty close.

CW This is what I've so far (which I'm very proud of!);

Congrats, it looks good.

%SETPATTREGEXP=(?im-s)^Date\:.*?([\d]{0,2}\:[\d]{0,2})\:[\d]{0,2}.*?([-+]\d{4})%-
%REGEXPBLINDMATCH=%HEADERS%-
%SUBPATT=1 GMT %SUBPATT=2%-

CW I'd like to remove the whole part about GMT +0100 to give me just
CW the time for the writer.

Delete everything after %SUBPATT=1.

-- 
Thanks for writing,
 Januk Aggarwal

Using The Bat! 1.60q under Windows 98 4.10 Build  A

Reality is merely an illusion, albeit a very persistent one.
  --Albert Einstein (1879-1955)


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: %CCLIST revisited

2002-06-24 Thread Januk Aggarwal

Hello Paul,

An archeological dig discovered that on Monday, June 24, 2002 at 07:47
GMT -0400, Paul Cartwright [PC] typed the following:

PC well, I read the URL and I read ( and reread ) this message. BUT I don't
PC know that much about REGEX, so could you maybe explain what this is,
PC how to install it and where it belongs??

Perhaps the beginning of that thread will help clarify things:
http://www.mail-archive.com/tbtech@thebat.dutaint.com/msg00631.html

The templates extract the recipients from the message and put them
into a vertical list wherever you insert the template.  See the above
link for reasons why you might want such a beast.

-- 
Thanks for writing,
 Januk Aggarwal

I have a stepladder. It's a very nice stepladder, but it's sad that I 
never knew my real ladder.   -- Craig Charles


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




  1   2   >