Tim,
On 06 Oct 2002 22:59:08 -0500, Tim Legant
<[EMAIL PROTECTED]> wrote:
>> So far, I have this:
>>
>> headers "^From\:( |[^@\s])*$" [EMAIL PROTECTED]
>
>What you really want is for the RE match to fail if you see an '@'
>after the 'From:'. You might find this RE does the same thing and is a little
>simpler:
"\AFrom:[^@]*\Z"
Thanks. I think I may be operating under some faulty assumptions, according to
which your RE would not work, so I'd appreciate some clarifications.
My whole approach was founded on the assumption that the RE is applied to the
entire header as one big string as opposed to trying to match each line of the
header individually. (eg, my mail client (Agent) seems to treat header filters
that way). Is this an incorrect assumption here?
Another assumption I am making is that the RE will match anywhere inside the
string (and that it is a prefix match). eg,
the RE "from" would match "xxxxxfromyyyyy"
Thirdly, that the RE [^@] will match a newline. So that [^@]* in your RE could
consume many lines of header until it found a @ having nothing to do with the
from header, or the end of the entire header.
Based on these assumptions, I was anchoring my RE to the beginning of a line
to avoid matching "From:" in the middle of another header such as a
received-by (leaving aside that those froms are probaby not capitalized), and
anchoring to the end of a line to avoid a runaway search.
IOW my RE was designed to match "From: " at the beginning of a line, followed
by other stuff not including a newline, followed by a newline.
_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users