Re: Need to cut the recipient's name

2004-03-30 Thread Robin Anson
On Tue 30 March 2004, 2:54:02 +1000, Marck D Pearlstone wrote:
MDP %IF:%ABtoGender=0:Spett.le:Egr. %-
MDP %SETPATTREGEXP=(.*)( - .*)?%-
MDP %REGEXPBLINDMATCH=%ABTOLASTNAME='%TOLNAME'%-
MDP %SUBPATT(1)

JO Don't Know why the brackets in ( - .*)? are useless, but it's running
JO well.

 They are important if you have any records without either - work
 or - home at the end. Then the expression will fail to match
 completely and result in a blank name. My version is the one to use.

When I tried this on an entry with smith - home as the last name, the
first expression matched the entire last name and left a zero occurrence
of the second expression. I thought the way around this was to set the
first expression in the regex to be (.*?) (I think the term is
non-greedy), but that simply failed to match anything then.

Can anyone explain why that might be the case?

-- 
Robin Anson
Using The Bat! v2.04.7 on Windows XP 5.1 Build 2600 Service Pack 1





Current version is 2.04.7 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Need to cut the recipient's name

2004-03-30 Thread Carsten Thönges
* Robin Anson writes:
 On Tue 30 March 2004, 2:54:02 +1000, Marck D Pearlstone wrote:

 MDP %IF:%ABtoGender=0:Spett.le:Egr. %-
 MDP %SETPATTREGEXP=(.*)( - .*)?%-
 MDP %REGEXPBLINDMATCH=%ABTOLASTNAME='%TOLNAME'%-
 MDP %SUBPATT(1)

 JO Don't Know why the brackets in ( - .*)? are useless, but it's running
 JO well.

 They are important if you have any records without either - work
 or - home at the end. Then the expression will fail to match
 completely and result in a blank name. My version is the one to use.

 When I tried this on an entry with smith - home as the last name, the
 first expression matched the entire last name and left a zero occurrence
 of the second expression. I thought the way around this was to set the
 first expression in the regex to be (.*?) (I think the term is
 non-greedy), but that simply failed to match anything then.

 Can anyone explain why that might be the case?

It's because the pattern doesn't need to match the whole subject.

This regexp should work: ^(.*?)(?: - .*)?$

--8---cut here---start-8---
%_testa=smith - work
%_testb=smith
%_testa
%_testb

%setpattregexp=^(.*?)(?: - .*)?$%-
1. a) %regexpmatch=%_testa
   b) %regexpmatch=%_testb
---
%setpattregexp=(.*?)(?: - .*)?%-
2. a) %regexpmatch=%_testa
   b) %regexpmatch=%_testb
--8---cut here---end---8---

Carsten
-- 



Current version is 2.04.7 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: cookie macro

2004-03-30 Thread Jonathan Angliss
On Tuesday, March 30, 2004, rich gregory wrote...

DH %SETPATTREGEXP='(.*?\n)(.*)'%-
DH %REGEXPBLINDMATCH(%COOKIE=c:\sigs.txt)%-
DH %WRAPPED(%SUBPATT(1))
DH%SUBPATT(2)%-

 It works SOMETIMES! Occasionally I get no signature at all with this
 code. I think the failures only occur in single-line entries, those
 that do not contain a \n and citation.

That would be a correct observation. Because nothing matches part 1 of
the query (anything up to a \n character), and as it never matched
that, the second part never matches either, because it's everything
after a \n character. You might be able to use a ? after the \n to
make it 0 or more.

-- 
Jonathan Angliss
([EMAIL PROTECTED])
Using The Bat! v2.05 Beta/12 on Windows XP 5.1 Build 2600 Service Pack 1

Contraceptives: use 'em on all conceivable occasions.


pgp0.pgp
Description: PGP signature

Current version is 2.04.7 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html

Re: cookie macro

2004-03-30 Thread dAniel hAhler
Hello bats,

on Tue, 30. Mar 2004 at 01:30:45 -0500 rich gregory wrote:

DH %SETPATTREGEXP='(.*?\n)(.*)'%-
DH %REGEXPBLINDMATCH(%COOKIE=c:\sigs.txt)%-
DH %WRAPPED(%SUBPATT(1))
DH%SUBPATT(2)%-
 It works SOMETIMES!
 Occasionally I get no signature at all with this code. I think the
 failures only occur in single-line entries, those that do not contain
 a \n and citation.

Yeah, of course. Because without a newline it will never match.

Change the Regex pattern as follows:
%SETPATTREGEXP='(.*?)(?:\n)?(.*)'%-

That will make the \n optional and if it gets matched, it won't be
inserted into the %SUBPATT stack, because of the '?:' after the opening
parenthesis.

Hope that will do it.. :)


-- 
shinE!
GnuPG/PGP key: http://thequod.de/danielhahler.asc
lifted with The Bat! 2.05 Beta/12 on Windows XP Service Pack 1.



Current version is 2.04.7 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Revisiting Mailto Problem

2004-03-30 Thread Thomas Fernandez
Hello Joseph,

On Mon, 29 Mar 2004 17:31:58 + (UTC) GMT (30/03/2004, 00:31 +0700 GMT),
Joseph N. wrote:

 Do you get the same results for those links (ie mailto-link in
 recipient field)? Or is it just missing subject/body?

JN I get the same results, i.e., mailto: link in
JN recipient field.

Confirmed.

-- 

Cheers,
Thomas.

Moderator der deutschen The Bat! Beginner Liste.

Wer am Ende ist, kann von vorne anfangen.

Message reply created with The Bat! 2.05 Beta/12
under Chinese Windows 98 4.10 Build  A 
using a Pentium P4 1.7 GHz, 256MB RAM





Current version is 2.04.7 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re[2]: Adding text to subject line - solved

2004-03-30 Thread P.Johnson
Robin,
On Monday, March 29, 2004, 12:21 PM, [EMAIL PROTECTED] wrote:
RA On Tue 30 March 2004, 9:21:05 +1000, P.Johnson wrote:
...
 ...Not sure what the #%- signifies (in the first line of the
 template)?

RA The # is a delimiter, everything between the first and second instances of
RA # are what happens if the from address is [EMAIL PROTECTED]

RA The %- is a line continuation marker that has the effect of preventing a
RA newline appearing in the output of the template.

Thanks for letting me know. This info opens up a whole new world
of possibilities for macros, which have always been something of
a mystery to me. :-)

-- 

Pat

A Canadian in Houston
Using The Bat! v2.04.7 on Windows XP 5.1 Build 2600 Service Pack 1




Current version is 2.04.7 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Need to cut the recipient's name

2004-03-30 Thread Robin Anson
On Tue 30 March 2004, 22:34:01 +1000, Carsten Thönges wrote:

...snip...

 It's because the pattern doesn't need to match the whole subject.
 
 This regexp should work: ^(.*?)(?: - .*)?$

Thanks Carsten.

It's obvious once you explain it and, of course, it's the detail that is
so important.

-- 
Robin Anson
Using The Bat! v2.04.7 on Windows XP 5.1 Build 2600 Service Pack 1




Current version is 2.04.7 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: cookie macro

2004-03-30 Thread Robin Anson
On Wed 31 March 2004, 1:47:20 +1000, Daniel Hahler wrote:
 Hello bats,
 
 on Tue, 30. Mar 2004 at 01:30:45 -0500 rich gregory wrote:
 
DH %SETPATTREGEXP='(.*?\n)(.*)'%-
DH %REGEXPBLINDMATCH(%COOKIE=c:\sigs.txt)%-
DH %WRAPPED(%SUBPATT(1))
DH%SUBPATT(2)%-
 It works SOMETIMES!
 Occasionally I get no signature at all with this code. I think the
 failures only occur in single-line entries, those that do not contain
 a \n and citation.
 
 Yeah, of course. Because without a newline it will never match.
 
 Change the Regex pattern as follows:
 %SETPATTREGEXP='(.*?)(?:\n)?(.*)'%-
 
 That will make the \n optional and if it gets matched, it won't be
 inserted into the %SUBPATT stack, because of the '?:' after the opening
 parenthesis.

You might need (and I'm guessing 'cos I haven't tried it)
%SETPATTREGEXP='^(.*?)(?:\n)?(.*)$'%-
to anchor the pattern to the beginning and end of the subject, otherwise it
could match any minimum number of characters with the first part.

See Carsten's answer to my similar question at
mid:[EMAIL PROTECTED]

-- 
Robin Anson
Using The Bat! v2.04.7 on Windows XP 5.1 Build 2600 Service Pack 1




Current version is 2.04.7 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Adding text to subject line - NOT solved

2004-03-30 Thread P.Johnson
I used the following macro in my account--forward template:

%IF:'%OFromAddr'='[EMAIL PROTECTED]':#%-
%ModifyOnce(Subject)%-
%Subject=FWD: (From Bill Smith) %OSubj
%TO=[EMAIL PROTECTED]#%-

...and this works, except that I made an error in the forwarding
address. It should be [EMAIL PROTECTED] When I add the period,
the message window comes up correctly but without any message
text!

Is there any work-around at all for this? The template does
exactly what it should, beautifully, otherwise.

(Though messages from [EMAIL PROTECTED] are not filtered into
the correct folder, for some reason. Very simple filter: just the
email address as the filter string (sender); the folder
specified. Doesn't budge though. Sigh.)

Sorry to bother you all with what must seem a basic problem.

Thanks!

-- 

Pat

A Canadian in Houston
Using The Bat! v2.04.7 on Windows XP 5.1 Build 2600 Service Pack 1



Current version is 2.04.7 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html


%Text wrapping behaviour in forward and reply templates

2004-03-30 Thread Robin Anson
TBUDL members

I use the %Text macro in both a reply template and a forward template in
one of my accounts. When I forward, the text from the original message is
wrapped. When I reply it is not.

I can even copy the contents of one template to the other (ie make the two
templates identical) and the same behaviour occurs.

Can anyone confirm that behaviour? Any ideas why?

-- 
Robin Anson
Using The Bat! v2.04.7 on Windows XP 5.1 Build 2600 Service Pack 1





Current version is 2.04.7 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html