Hello Ulrich,

UP = Ulrich Peters 

On  Tue, 9 Jan 2001  at  21:47:04 GMT -0200 (which was 3:47 PM where I
live) witnesses say Ulrich Peters typed:

UP> Normally the first message received is generated with a FormMail
UP> script, and I have set up a regex to create a reply with only the
UP> relevant text of the FormMail. This text comes between the strings
UP> "Comment: " and "Submit". Here is the regex which works well for this
UP> purpose:

UP> <one line>
UP> %QUOTES='%WRAPPED="%SETPATTREGEXP=""Comment:
UP> (.*)Submit(.*)""%RegExpBlindMatch=""%TEXT""%SubPatt=""1"""'
UP> </one line>

UP> The trouble is that there are normally subsequent messages to be
UP> exchanged with this same person, and then the QUOTES should have to
UP> work as they normally would, without using the regex. Using this regex
UP> on further messages don't produce *any* quotations, because there is
UP> no Comment/Submit match, obviously.

How about something like:
%QUOTES='%SETPATTREGEXP="(?(?=;;);;(.*)|(.*);;)"%REGEXPBLINDMATCH="%QINCLUDE=""special"";;%TEXT"%SUBPATT="2"

Where you define a Quick Template with handle 'special' that has:

%SETPATTREGEXP="Comment:(.*)Submit(.*)"%RegExpBlindMatch="%TEXT"%SubPatt="1"

This might run into problems if there is ';;' in any of the
messages.  There are probably better options:

UP> My problem is how to activate the regex and extract only part of the
UP> message IF it comes from the FormMail, and how to make the quotes work
UP> normally when the message does NOT come from the FormMail - using one
UP> single message folder and same reply template for everything. I
UP> couldn't figure it out.

Is there any string or address or something that uniquely identifies
the FormMail messages or headers?  If there are, then you could create
a couple of Quick Templates, and based on the existence of the unique
identifier, call the appropriate Quick Template.  But I need more
information before I get specific.

UP> Another thing I would like to know is how to eliminate empty lines
UP> completely in the quoted text... with the same regex hopefully...?

That's beyond the capability of regexps.  You want text editing
capabilities.  Regexps are used for retrieving information from text.
There is a difference.


 

-- 
Thanks for writing,
 Januk Aggarwal

 Using The Bat! 1.49
 under Windows 98 4.10 Build 2222  A 

-- 
--------------------------------------------------------------
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]>
--------------------------------------------------------------

You are subscribed as : [email protected]


Reply via email to