How to add a GMail filter for multiple accounts

Let’s say you want to filter messages sent to [email protected] and [email protected] and apply the ‘MyCompany’ label to those messages. You may think that typing the following in the ‘To’ field of the filter will work:

[email protected], [email protected]

but it doesn’t. It doesn’t work with ; either.

In order to add multiple addresses to the filter you have to separate them with a | or wrap them in parentheses and use OR as the separator. The following are working examples:

[email protected] | [email protected]
([email protected] OR [email protected])

The same can be applied when searching email.