procmail
[Top] [All Lists]

Re: Trouble with multi-line MATCH

2000-02-18 02:57:00
Hello,

"PG" == Philip Guenther <guenther(_at_)gac(_dot_)edu> writes:

PG> Ralph SOBEK <sobek(_at_)irit(_dot_)fr> writes:
On a related note, since "The regexp engine has to keep track
of all of those possibilities", will one day exist a possibility to
backtrack and find the *next* match, in the case that the first one
does not succeed completely.  Can you add this to the "Wish List"?
This may be too much for procmail.  Maybe I should look at something
else.  Any suggestions?

PG> Well, that's what the regexp engine does already.  If later parts of

That is what I thought!

PG> the regexp don't match then the other possibilities are considered
PG> (actually, it considers them simultaneously).  If you're talking about
PG> applying non-regexp conditions on the later part of the match (e.g.,
PG> "match two multi-digit space separated numbers, requiring the first one
PG> to be larger than the second") then that's a *lot* more complicated.

Yes!  For example:

:0
* 9876543210^0 $ ^(From|Subject):.*\/\<(${regexp})s?\>.*$
* 9876543210^0 B ?? $ ()^\/.*($.*)?\<(${regexp})s?\>.*($.*)?
{
   LINES = $MATCH
}

:0 A
*$ MATCH ?? ()\/$regexp
{
   NAME = $MATCH
   LOG = "--> Name = $NAME <--$NL"
}

# Baier is one of the patterns in $regexp
:0 a:
* NAME ?? Baier
* ! LINES ?? Research: SOBEK, BAIER/BEIER
$outfile

In this case, I would like to continue the initial match from the tail
of the first find.  Maybe all that would be necessary would be a
"goto" operator or "next match" operator, that would continue the
process where the last was left off.  May this be possible?

PG> Perl's mongo regexps can do this with the new, experimental, and scary
PG> "(?{ code })" syntax, but lacking a good base language, this is quite a
PG> bit beyond the capabilities and desgin of procmail.

Maybe I would need such a `mongo' regexp compiler!

Cheers,

        --Ralph

Dr. Ralph P. Sobek                Disclaimer: The above ruminations are my own.
Ralph(_dot_)Sobek(_at_)irit(_dot_)fr                       Addresses are 
ordered by importance.
sobek(_at_)irit(_dot_)fr                                                If all 
else fails, try:
newsmaster(_at_)irit(_dot_)fr, postmaster(_at_)irit(_dot_)fr             
sobek(_at_)diva(_dot_)eecs(_dot_)berkeley(_dot_)edu
Ph:(+33)[0]561558618  FAX:(+33)[0]561556258  http://www.irit.fr/~Ralph.Sobek/
===============================================================================
Urgent!! Greenhouse Effect: http://www.irit.fr/~Ralph.Sobek/greenhouse.html

<Prev in Thread] Current Thread [Next in Thread>