Hello bats,

on Wed, 4. Feb 2004 at 23:32:18 -0800 Januk Aggarwal wrote:

DH>> I tried this before.. %REGEXPMATCH is still empty
J> Yes, this is correct.  %Regexpmatch only gets populated with
J> subpattern 1 if it exists, otherwise subpattern 0.  In your
J> expression, the test string gets matched by different subpattern.

Ah.. that's good to know.. ;)

DH>> and SUBPATT gets also set without "clear" subpatterns.
J> I'm not sure what you mean.

That SUBPATT wasn't set either without the extra parenthesis. But I
must have missed sth, because it just did.

DH>> So, what I want to do is getting the name of the mailinglist (before
DH>> the '@'), but for different lists.

J> I suppose you could do it using two nested regexps. But that's even
J> less optimal. In theory at least, you can have one expression
J> extract the whole address, then extract the username with the other
J> expression. The following should work, though with the new scope of
J> regexp definitions, I'm not entirely sure.

It does. Great idea.

J> =====[Begin nested]=====
J> %SetPattRegexp='^(.*)@'%-
J> %RegExpMatch='%-
J> 
%___%SetPattRegexp="(((tbudl|tbbeta|tbdev|tbtech|tbot)@thebat\.dutaint\.com)|((test)@test\.de)|((thebat-dt)@lists\.dekadent\.net))"%-
J> %___%RegExpMatch="[EMAIL PROTECTED]"'
J> =====[ End  nested]=====

what's with '%___'? Seems to act only for indenting.. never seen this
before..

J> =====[Begin QT fragment]=====
J> 
%SetPattRegexp='((tbudl|tbbeta|tbdev|tbtech|tbot)@thebat\.dutaint\.com)|((test)@test\.de)|((thebat-dt)@lists\.dekadent\.net)'%-
J> %RegexpBlindMatch='[EMAIL PROTECTED]'%-
J> %Subpatt='2'%Subpatt='4'%Subpatt='6'%-
J> =====[ End  QT fragment]=====
J> Since only one of them can match, only one of the subpatterns will be
J> filled.  As written, that means the other two %Subpatt calls do
J> absolutely nothing to the string that will be returned.

I'll stick with the first suggestion, because only the nested
RegexpPattern has to be edited for a new mailinglist. And I find it
smarter.

Thanks.


-- 
shinE!
http://www.thequod.de ICQ#152282665
GnuPG/PGP key: http://thequod.de/danielhahler.asc

Using The Bat! v2.03 Beta/53 on Windows XP 5.1 Build 2600 Service Pack 1
with POPFile 0.20.1 and avast Jan2004 (4.1.342)


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

Reply via email to