Benny Pedersen
2018-May-07 16:43 UTC
[sieve][regex] Matching multiple strings in the "Received" header
Adi Pircalabu skrev den 2018-05-07 05:10:> How should I write it to also match the space character at both the > beginning and end of the expression?use \ before space char
Adi Pircalabu
2018-May-08 01:38 UTC
[sieve][regex] Matching multiple strings in the "Received" header
On 08-05-2018 2:43, Benny Pedersen wrote:> Adi Pircalabu skrev den 2018-05-07 05:10: > >> How should I write it to also match the space character at both the >> beginning and end of the expression? > > use \ before space charTks. Just tried these two, unsuccessfully: "\.from.*(outbound.protection.outlook.com|.google.com|.yahoo.com|mx.aol.com)\." "\ from.*(outbound.protection.outlook.com|.google.com|.yahoo.com|mx.aol.com)\ " However, this expression always matches: "from.*(outbound.protection.outlook.com|.google.com|.yahoo.com|mx.aol.com)" What am I missing? --- Adi Pircalabu
Gerald Galster
2018-May-08 06:20 UTC
[sieve][regex] Matching multiple strings in the "Received" header
Hello Adi, did you try: " from.*(outbound.protection.outlook.com|.google.com|.yahoo.com|mx.aol.com) " If you need to specify the posix character class: [[:blank:]] means space and tab. With pcre it would be like [ \t] [[:space:]] includes space, tab, newline, linefeed, formfeed, vertical tab (in pcre like [ \t\n\r\f\v]) "[[:blank:]]from.*(outbound.protection.outlook.com|.google.com|.yahoo.com|mx.aol.com)[[:blank:]]" Best regards, Gerald> Am 08.05.2018 um 03:38 schrieb Adi Pircalabu <adi at ddns.com.au>: > > On 08-05-2018 2:43, Benny Pedersen wrote: >> Adi Pircalabu skrev den 2018-05-07 05:10: >>> How should I write it to also match the space character at both the >>> beginning and end of the expression? >> use \ before space char > > Tks. Just tried these two, unsuccessfully: > "\.from.*(outbound.protection.outlook.com|.google.com|.yahoo.com|mx.aol.com)\." > "\ from.*(outbound.protection.outlook.com|.google.com|.yahoo.com|mx.aol.com)\ " > > However, this expression always matches: > "from.*(outbound.protection.outlook.com|.google.com|.yahoo.com|mx.aol.com)" > > What am I missing? > > --- > Adi Pircalabu
Possibly Parallel Threads
- [sieve][regex] Matching multiple strings in the "Received" header
- [sieve][regex] Matching multiple strings in the "Received" header
- [sieve][regex] Matching multiple strings in the "Received" header
- [sieve][regex] Matching multiple strings in the "Received" header
- [sieve][regex] Matching multiple strings in the "Received" header