I'm trying to set up a filter tickets that contains the words xxx or yyy but not zzz.
I set the field body Look for value: .*(xxx|yyy).*
and body - negation - Look for value: .*(zzz).*
Unfortunately, it does not work, because the second body condition disappears.
Postmaster filter - regular expression "but not"
Moderator: crythias
-
- Znuny newbie
- Posts: 78
- Joined: 30 Jan 2014, 15:27
- Znuny Version: 4.0.19
- Location: Poland
- Contact:
Postmaster filter - regular expression "but not"
OTRS 4.0.19/6.0.26, openSUSE 12, MySQL 5.5
KodIT Usługi Informatyczne - Odzyskiwanie danych Poznań - Serwis Komputerowy
KodIT Usługi Informatyczne - Odzyskiwanie danych Poznań - Serwis Komputerowy
-
- Znuny guru
- Posts: 5018
- Joined: 13 Mar 2011, 09:54
- Znuny Version: 6.0.x
- Real Name: Renée Bäcker
- Company: Perl-Services.de
- Contact:
Re: Postmaster filter - regular expression "but not"
I hope I've covered all possibilities:
So try in your filter
Code: Select all
#!/usr/bin/perl
use v5.10;
use strict;
use warnings;
my @strings = ('xxx yyy zzz', 'xxx zzz', 'xxx yyy', 'yyy zzz', 'aaa yyy', 'aaa bbb', 'xxx bbb', 'aaa xxx', 'yyy abc', 'zzz yyy', 'zzz abc', 'abc zzz');
for my $string ( @strings ) {
say $string, ": ", ($string =~ m{^(?!.*zzz)(?=.*(?:xxx|yyy))(?!.*zzz)}xms);
}
Code: Select all
^(?!.*zzz)(?=.*(?:xxx|yyy))(?!.*zzz)
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
-
- Znuny newbie
- Posts: 78
- Joined: 30 Jan 2014, 15:27
- Znuny Version: 4.0.19
- Location: Poland
- Contact:
Re: Postmaster filter - regular expression "but not"
Thank you very much for your help! It seems to be good.
OTRS 4.0.19/6.0.26, openSUSE 12, MySQL 5.5
KodIT Usługi Informatyczne - Odzyskiwanie danych Poznań - Serwis Komputerowy
KodIT Usługi Informatyczne - Odzyskiwanie danych Poznań - Serwis Komputerowy