On Fri, 17 Dec 1999 10:16:14 +0800, Thomas Fernandez wrote:

> on Thursday, December 16, 1999, 7:44:46 PM GMT+0800, Peter Steiner wrote:

PS>> The macros for stripping down all Re:'s and Aw:'s look like:

PS>> %SETPATTREGEXP="(?i)((Re|Aw)\:\s*)*(.*)"
PS>> %REGEXPBLINDMATCH="%OSUBJ"
PS>> Re: %SUBPATT="3"

PS>> The normal way to replace the subject of a message is
PS>> %SUBJECT=""%SUBJECT="Re: (This was the original subject)"

> Not quite. In Z notation, what you want is:

What's Z notation?

> Subject'= "Re" + Subject\Replyparam

Almost Agreed, it should be "Re: " + Subject\Replyparam

> where Replyparam is "Re", "Aw" or "AW". Note that the original subject
> has to be stripped off the original reply parameter. I trust that your
> RegExp above has this "or" function and gives you the correct result.
> However, Alex said before that RegExp's cannot replace, only find. I
> don't know anything about this.

The stripping works well. A short explanation what the RegExp does,
working from the inside out:

%SETPATTREGEXP="(?i)((Re|Aw)\:\s*)*(.*)"

1. "(?i)" RegExp option: work case insensitive (so Aw and AW are
   matched)
2. "(Re|Aw)" matches Re or Aw.
3. "(Re|Aw)\:\s*" matches Re: or Aw: followed by any number of
   whitespace (spaces, tabs)
   This can be easily expanded, eg "(Re|R|Ref|Aw|Antwort)\:\s*" for
   more languages
4. "((Re|Aw)\:\s*)*" matches any number of repetitions of (3.). If
   we have "AW: Re: Aw: Re: Example Subject" it matches
   "AW: Re: Aw: Re: "
5. "(.*)" matches the rest. In the example above this would be
   "Example Subject"

%REGEXPBLINDMATCH="%OSUBJ"
Re: %SUBPATT="3"

As we are not interested in all matches, but only in the one from
Step 5, we need to tell which part. The 'BLINDMATCH' macro does all
the matching without putting any text out. The %SUBPATT="3" is the
match from inside the third pair of parentheses (not counting the
option setting "(?i)"). This is step 5 from above. Then we have to
add a Re: in front, yielding my

Re: %SUBPATT="3"

PS>> %SUBJECT=""%SUBJECT="%QINCLUDE="strip-re-intl""

> I think you have one set of quotation marks too many.

Yes. That is exactly my problem.

> Does this work?:
> %Subject=""%Subject=%QInclude="strip-re-intl"

No, it yields a subject "QInclude=" ... :-(

Regards

Peter
-- 
Peter Steiner <[EMAIL PROTECTED]>        PGP-ID 0x02850F53 (DH/DSS)
PGP Fingerprint 68AB D08E D995 41B4 C6FD  639D 9B94 D249 0285 0F53
"Uuuh, isch das e botterepfloorigi Schtr�pfete gsi! Die zwee hei
gschwouderet u ghetzpacheret, das si z n�bis meh gw�sst hei, wo
se der G�rchu zwurglet." - Franz Hohler

-- 
--------------------------------------------------------------
View the TBUDL archive at http://tbudl.thebat.dutaint.com
To send a message to the list moderation team double click here:
   <mailto:[EMAIL PROTECTED]>
To Unsubscribe from TBUDL, double click here and send the message:
   <mailto:[EMAIL PROTECTED]>
--------------------------------------------------------------

Reply via email to