Re: [exim] Regexp match on a header

Top Page
Delete this message
Reply to this message
Author: Heiko Schlittermann
Date:  
To: exim-users
Subject: Re: [exim] Regexp match on a header
Heiko Schlittermann <hs@???> (Di 27 Dez 2016 12:13:56 CET):
> Ian Zimmerman <itz@???> (Di 27 Dez 2016 05:22:33 CET):
> …
> >   warn
> >         set acl_m_data_rip = ${if match {$bh_received:}{\N[[](\d+[.]\d+[.]\d+[.]\d+)[]]\N} $1 {}}
>           set acl_m_data_rip = ${if match {$bh_received:}{\N[[](\d+[.]\d+[.]\d+[.]\d+)[]]\N}{$1}{}}


And additionally I'd write the expression as

    \[((?:\d+\.){3}\d+)\]


or obfuscate it even more ;)

    \[((?:\d+(?:\.(?=\d+))?){4})\] 


    Best regards from Dresden/Germany
    Viele Grüße aus Dresden
    Heiko Schlittermann
-- 
 SCHLITTERMANN.de ---------------------------- internet & unix support -
 Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} -
 gnupg encrypted messages are welcome --------------- key ID: F69376CE -
 ! key id 7CBF764A and 972EAC9F are revoked since 2015-01 ------------ -