procmail
[Top] [All Lists]

Re: test variable value

2001-02-26 07:29:14
Don Hammond followed up,

| So returning to my question, there is a functional difference between:
| 
| * var ?? ^^regexp^^
| 
| and
| 
| * var ?? ^regexp$
| 
| but only if var contains a value with multiple [new]lines. Right?

Ooh gosh.  If you want a short, oversimplified answer, wait for someone else
to respond.

If there can be no embedded newlines in the value of the variable and there
are none in the regexp either, then those are equivalent.  Thing is, unlike
egrep, procmail allows embedded newlines inside regexps.  So let's put it
this way: there's a functional difference only if the value of the variable
can cover more lines than the regexp does.  In that case, the value of the
variable often ends in a real newline, and a closing ^^ will match only the
putative newline, so the condition will need to look something like

  multilinevar ?? ^^regexp($)^^

to test whether the entire value of the variable is described by the regexp.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail