Re: [exim] Regular expressions in .forward files?

Pàgina inicial
Delete this message
Reply to this message
Autor: Robert Nicholson
Data:  
A: exim-users@exim.org
Assumpte: Re: [exim] Regular expressions in .forward files?
Is it still a character class like that?

Sent from my iPhone

On Mar 21, 2009, at 3:14 PM, Phil Pennock <exim-users@???>
wrote:

> On 2009-03-21 at 11:21 -0500, Robert Nicholson wrote:
>> Is there a way to use the following regex in .forward files with the
>> match operator?
>>
>> if $rheader_from: matches "[^\x00-\x7f]\{5,\}"
>> or $rheader_subject: matches "[^\x00-\x7f]\{5,\}"
>>
>> I get
>>
>> rheader_from: matches [^ or $rheader_subject: matches [^
>> Filter error: error while compiling regular expression "[^": missing
>> terminating ] for character class at offset 2
>
> The Exim string layer takes the \x00 to make a NUL character which
> terminates the regex string.
>
> filter.txt "3.22 String testing conditions" ends with a description of
> regexp quoting past the string layer and the quote layer. See:
> http://www.exim.org/exim-html-current/doc/html/filter.html#SEC23
> for details.
>
> Probably (and untested):
> if $rheader_from: matches \N^\x00-\x7f]{5,}\N
>
> Regards,
> -Phil