I know that a | is used for "or" in a regex expression as in yes|no but what is the symbol for "and"?
Thanks.
AJ
regex question - symbol for "and"
- allangjohnson
- Travelling Tuatara
Post
regex question - symbol for "and"
Last edited by allangjohnson on Sun Aug 08, 2010 2:53 am, edited 1 time in total.
- anniebrion
- βeta Tester
- Contact:
- Location: Milkyway, Sol, Earth, UK, London
Post
Re: regex question - symbol for "and"
Everything that is not an or (|) is an and.
Annie.......... PC details
Mailwasher Pro βeta [v 7.12.39]
Mailwasher Pro βeta [v 7.12.39]
- allangjohnson
- Travelling Tuatara
Post
Re: regex question - symbol for "and"
That was quick - thanks.
So, if I write
(.+@){10,} [email protected]
that would catch anything that was both sent to ten or more recipients AND was from [email protected]?
AJ
So, if I write
(.+@){10,} [email protected]
that would catch anything that was both sent to ten or more recipients AND was from [email protected]?
AJ
- anniebrion
- βeta Tester
- Contact:
- Location: Milkyway, Sol, Earth, UK, London
Post
Re: regex question - symbol for "and"
The from: test would go in a separate rule and set the rules to ALL instead of ANY.
Last edited by anniebrion on Sun Aug 08, 2010 3:09 am, edited 1 time in total.
Annie.......... PC details
Mailwasher Pro βeta [v 7.12.39]
Mailwasher Pro βeta [v 7.12.39]
- allangjohnson
- Travelling Tuatara
Post
Re: regex question - symbol for "and"
That's what I was hoping to avoid, because I wanted that filter to be one line in a multiline filter that would be tripped in ANY condition was satisfied.
AJ
AJ
- anniebrion
- βeta Tester
- Contact:
- Location: Milkyway, Sol, Earth, UK, London
Post
Re: regex question - symbol for "and"
It's difficult testing to: & from: in the same single rule as I have tried to do this in the past 
The major issue is that email headers are not standardized enough, sometimes the to: comes before the from: other times it is the reverse, also sometimes a subject: is inbetween and sometimes not

The major issue is that email headers are not standardized enough, sometimes the to: comes before the from: other times it is the reverse, also sometimes a subject: is inbetween and sometimes not

Annie.......... PC details
Mailwasher Pro βeta [v 7.12.39]
Mailwasher Pro βeta [v 7.12.39]
- allangjohnson
- Travelling Tuatara
Post
Re: regex question - symbol for "and"
I understand. But am I correct that just putting a space between the two items makes it an "AND"?
So, using a different example, if the filter looks in the subject line for
hot cold
it would trip only if the subject line contained both words?
AJ
So, using a different example, if the filter looks in the subject line for
hot cold
it would trip only if the subject line contained both words?
AJ
- anniebrion
- βeta Tester
- Contact:
- Location: Milkyway, Sol, Earth, UK, London
Post
Re: regex question - symbol for "and"
NO putting a space is not an AND.
The and is ie:
"1 or more characters" AND @ AND domain
(fred OR fred) AND @ AND domain
The and is ie:
Code: Select all
.+@domain
Code: Select all
(fred|bert)@domain
Last edited by anniebrion on Sun Aug 08, 2010 3:31 am, edited 1 time in total.
Annie.......... PC details
Mailwasher Pro βeta [v 7.12.39]
Mailwasher Pro βeta [v 7.12.39]
- allangjohnson
- Travelling Tuatara
Post
Re: regex question - symbol for "and"
Sorry to be so slow, but why isn't
(fred|bert)@domain)
(fred OR fred) AND @ AND d AND o AND m AND a AND i AND n?
AJ
(fred|bert)@domain)
(fred OR fred) AND @ AND d AND o AND m AND a AND i AND n?
AJ
- anniebrion
- βeta Tester
- Contact:
- Location: Milkyway, Sol, Earth, UK, London
Post
Re: regex question - symbol for "and"
It is but I couldn't be bothered to do all the ANDs
and it looks tidier than:
"1 or more characters" AND @ AND d AND o AND m AND a AND i AND n
Or
((f AND r AND e AND d) OR (b AND e AND r AND t)) AND @ AND d AND o AND m AND a AND i AND n
The last one makes the AND and ORs harder to spot.

"1 or more characters" AND @ AND d AND o AND m AND a AND i AND n
Or
((f AND r AND e AND d) OR (b AND e AND r AND t)) AND @ AND d AND o AND m AND a AND i AND n
The last one makes the AND and ORs harder to spot.
Annie.......... PC details
Mailwasher Pro βeta [v 7.12.39]
Mailwasher Pro βeta [v 7.12.39]
- allangjohnson
- Travelling Tuatara
Post
Re: regex question - symbol for "and"
So there isn't a way to have a single line that trips a filter if the subject line contains
hot AND cold
AJ
hot AND cold
AJ
- anniebrion
- βeta Tester
- Contact:
- Location: Milkyway, Sol, Earth, UK, London
Post .* = Zero or more characters
\x20 = Space
Re: regex question - symbol for "and"
Yes there is but they have to be in the right order or you will need 2 rulesallangjohnson wrote:So there isn't a way to have a single line that trips a filter if the subject line contains
hot AND cold
AJ
Code: Select all
hot\x20.*cold
Code: Select all
cold\x20.*hot
\x20 = Space
Last edited by anniebrion on Sun Aug 08, 2010 4:22 am, edited 2 times in total.
Annie.......... PC details
Mailwasher Pro βeta [v 7.12.39]
Mailwasher Pro βeta [v 7.12.39]
- allangjohnson
- Travelling Tuatara
Post
Re: regex question - symbol for "and"
or could it be in a single line as
hot.*cold|cold.*hot
?
AJ
hot.*cold|cold.*hot
?
AJ
- anniebrion
- βeta Tester
- Contact:
- Location: Milkyway, Sol, Earth, UK, London
Post
Mabye:
But I'm sure you get the idea.
Re: regex question - symbol for "and"
Simplistically yes, but that would match subject = "Hotdogs and coldfish"allangjohnson wrote:or could it be in a single line as
hot.*cold|cold.*hot
Mabye:
Code: Select all
hot(\x20|$).*cold(\x20|$)|cold(\x20|$).*hot(\x20|$)
Last edited by anniebrion on Sun Aug 08, 2010 4:24 am, edited 1 time in total.
Annie.......... PC details
Mailwasher Pro βeta [v 7.12.39]
Mailwasher Pro βeta [v 7.12.39]
- allangjohnson
- Travelling Tuatara