On Thu, Nov 24, 2022 at 04:07:29PM +0000, DEMBLANS Mathieu wrote:

> We thought that it was case sensitive but not.

    http://www.postfix.org/pcre_table.5.html
    http://www.postfix.org/regexp_table.5.html

For case-sensitive matching:

    /pattern/i  action

and to match whole words case-sensitively with PCRE:

    /\bWord\b/i  action

Don't decorate your regular expressions with redundant ".*$".
Consider using "if ... endif" blocks.

    if /precondition/
    /pattern1|pattern2|pattern3/    actionA
    /pattern4|pattern5/    actionB
    /^/     DUNNO
    endif

The "DUNNO" avoid looking in other "if /precondition/ ... endif" blocks,
and is appropriate when the preconditions are mutually exclusive.

    if /^From:/
    ...
    /^/ DUNNO
    endif

    if /^Subject:/
    ...
    /^/ DUNNO
    endif

    if /^X-Mailer:/
    ...
    /^/ DUNNO
    endif

    ...

--
    Viktor.

Reply via email to