Re: [exim] Result repeated and contains a newline character …

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Philip Hazel
日付:  
To: exim-users
CC: jaco engelbrecht
題目: Re: [exim] Result repeated and contains a newline character ?
On Wed, 28 Mar 2007, Jakob Hirsch wrote:

> You X-Spammark header obviously contains "0.00\n0.00" (just as your


Aha! Yes, that must be it.

> X-ClamAV contains "clean\nclean"). ${sg...} seems to operate on every
> line seperately, just like
> Don't know why this isn't in the spec (Philip?).


It doesn't operate on every line separately. However, it does operate
like Perl's s/xxx/yyy/g which is why it's called sg. The g is for
"global". After making one change, it seeks further down the string for
further matches.

> You should fix that. An ugly workaround would be like
>
> > ${sg {100.0\n100.0} {\N(?s)(\d+).*\N} {\$1}}
> 100


It might be as well to anchor the regex too, just to be on the safe
side:

${sg {100.0\n100.0} {\N^(?s)(\d+).*\N} {\$1}}

-- 
Philip Hazel            University of Cambridge Computing Service
Get the Exim 4 book:    http://www.uit.co.uk/exim-book