Januk,
you wrote on Tuesday, April 24, 2001, 06:02:08:
[snip]
RB>> and I use the "Reply" or "Reply to all" function, then the regular
RB>> expression should always strip the leading "xxx." from
RB>> [EMAIL PROTECTED], turning it into just [EMAIL PROTECTED]
JA> I'm thinking you might be asking a bit much from a regular expression.
JA> You could come up with some relatively limited regexps that could
JA> handle parts of the task. Before I make an attempt, could you give
JA> some more info please?
Sure, thanks for the reply!
JA> - What is the maximum number of recipients in any of these fields?
I think we can limit that to 10.
JA> - Do you want to keep the person's name, ie:
JA> "Ralf" <[EMAIL PROTECTED]>
JA> becomes
JA> "Ralf" <[EMAIL PROTECTED]>
That would be great.
JA> - Are these addresses that need to be stripped from a limited number
JA> of people? In other words, could you put them in your address book?
Yes. In fact, I only need this for exact one address.
JA> If you can put them in your address book, you might be able to get
JA> away with using some of the %AB macros.
Can you tell me more about this? Where are the %AB macros documented?
Thanks!
[snip]
JA> I think Perl would be a better tool for what you want. If you can get
JA> someone to create an appropriate Perl script, we can help you get it
JA> to work with TB to make something similar to what you want.
Well, Perl I know a little ... it would be simple here ($TO and $CC
would be %TO and %CC for TB!):
$TO =~ s/xxx\.user\@domain\.com/user\@domain\.com/gi;
$CC =~ s/xxx\.user\@domain\.com/user\@domain\.com/gi;
RB>> I looked at the examples in the online help, but unfortunately
RB>> regular expressions seem to be very difficult to understand
JA> You need to break it down into small bits and see what they do. I
JA> encourage you to look through the archives of this list in particular.
JA> There are several threads that try to go through some examples in
JA> great detail.
I will do that. Actually, I do know the basics of regular expressions,
it's just hard to understand how TB! uses them.
RB>> and the help on regular expressions in general is lacking
JA> Actually, the info in the help file is *very* good, but the learning
JA> curve is a bit steep. There are lots of regexp books available for the
JA> overall concept, and these lists are great for the TB-specific stuff.
I've mainly got my knowledge from a package called "SelfHTML", the
German TB! help has some examples from there as well.
RB>> (what is %SUBPATT, %SETPATTREGEXP and %REGEXPBLINDMATCH, anyway?).
JA> %SUBPATT="x" - is where the matched information is stored.
JA> x runs from 0-99, IIRC.
So it is like a variable?
JA> %SETPATTREGEXP - This tells TB the pattern we're looking for.
JA> %REGEXPBLINDMATCH - Telling TB what text to examine. Results are
JA> stored in the subpatterns, and that's it.
JA> %REGEXPMATCH - Same as above, but also returns Subpattern 1. If
JA> Subpattern 1 is empty, returns Subpattern 0.
Currently escapes me :-) I'll play around with it.
Thanks again.
Ralf.
--
--
______________________________________________________
Archives : <http://tbtech.thebat.dutaint.com>
Moderators : <mailto:[EMAIL PROTECTED]>
Unsubscribe: <mailto:[EMAIL PROTECTED]>
You are subscribed as : [email protected]