Re: Help with regex

2001-01-10 Thread Ulrich Peters

Hi...

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

Ok. I didn't understand the meaning of the "(?(?=;;);;(.*)|(.*);;)"
part, could you tell me where I can find an analysis of this string?

Before asking on this list I looked the explanations of assertions and
conditional regex, but I couldn't understand what they were trying to
say in the help. Ah, and in Friedl's "Mastering regular expressions
book" there is no mention of assertions. At least not under this name.


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

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

Yes. The FormMail messages do always begin with "Below is the result
of your feedback form." and have the field markers "Comment: " and
"Submit". The other messages don't.

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

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

No, not exactly. Maybe you want to say that regex inside TheBat
can't do this, but otherwise they sure can. I am used to to this kind
of regex in Perl all the time, for example something like

$text =~ s/([\n|\r]){2,}/\n\r/g;

will get rid off all extra newline characters in Perl (inside a DOS
file). As TheBat translates the CR+LF to just LF, it should work with
something as easy as

$text =~ s/(\n){2,}/\n/g;

to eliminate empty lines in the message body.

Cheers,
   Ulrich

-- 
--
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 : archive@jab.org





Help with regex

2001-01-09 Thread Ulrich Peters

Hello,

is there any regex expert on this list? I can't figure out a solution
for my problem:

I have a filter which sends all messages for a specific topic into a
separate folder. No problem here.

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

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

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

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

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

Any ideas?

Cheers,
   Ulrich

-- 
--
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 : archive@jab.org