Thursday, July 20, 2006, Chris W. [EMAIL PROTECTED] wrote:

> [EMAIL PROTECTED] @ 2006-7-20 1:59:06 AM
> "Is there a way to set up a Reply to automatically use a specific
> Account based on the Subject?"
> <mid:[EMAIL PROTECTED]>

>>> For this, take a look at regular expressions.

>> I looked at Regular Expressions in online help; and it is all greek
>> to me. Would appreciate if someone would provide me with the exact
>> syntax.

> I'm only a regular expression novice, so this (UNTESTED) solution
> probably could be improved:

> %SETPATTREGEXP='.*(\[FCNYC\]).*'%-
> %IF:'%REGEXPMATCH="%OSUBJECT"'<>'':'%ACCOUNT="Account3"':'%ACCOUNT="Zworg"'%-

> The %SETPATTREGEXP line tells The Bat! to look for "[FCNYC]" anywhere
> in a string and capture it. Then, %REGEXPMATCH is called with the old
> subject. If "[FCNYC]" is in the old subject, the result of
> %REGEXPMATCH is "[FCNYC]", otherwise the result is the empty string,
> "". Therefore, the %IF tests to make sure that %REGEXPMATCH did not
> result in the empty string. If the result was non-empty, Account3 is
> used, otherwise Zworg is used.

Thanks, Chris, it works.


-- 
Thanks in advance
JM


Using The Bat! 2.12.04
Under Windows XP 5.1 Build 2600 Service Pack 1




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

Reply via email to