Creating a complex rule for a shared mailbox in o365 Outlook

Anonymous
2025-02-25T12:25:46+00:00

Hey there,

I have shared access to a teammailbox via o365 (web interface). I need to create a rule to sort messages based on two words from message subject.

The messages subject are in the following format:

ABC some random text X001

ABC some random text X002

ABC some random text X003

DFE some random text X001

DFE some random text X002

DFE some random text X003

GHJ some random text X001

GHJ some random text X002

GHJ some random text X003

I need a rule to deploy the messages which contain: ABC and (X001 OR X003) to the desired folder.

In regex: ABC.*(001|003)

I have tried the regex expression but unfortunately not working with Outlook on the Web (or I don't know the exact format how to use it). If I use only one word I get a lot of false matches.

Is there any possibility to sort messages on the desired way in one rule?

Thank you.

Attila.

Outlook | Web | Outlook on the web for business | Settings

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2025-02-25T13:58:12+00:00

    Hello L.Attila**,**

    Good day! Thank you for reaching out to Microsoft community.

    As per your description, it seems like that you have access to a shared mailbox in Microsoft 365 Outlook (Web Interface) and want to create a rule to automatically sort emails based on two specific conditions in the subject line:

    • The subject must contain "ABC" AND
    • It must also contain either "X001" or "X003".

    You attempted to use regular expressions (regex), but Outlook’s built-in rules do not support regex. Instead, Outlook rules primarily work with "contains" or "matches specific words" filters.

    For your information, in Outlook the regular expressions (regex)are not supported directly in the Outlook Web and desktop client rules.

    However, if you need more advanced filtering options, you can use regular expressions in mail flow rules (also known as transport rules) in Exchange Online.

    • As per Microsoft KB: You can use regular expressions (RegEx) in conditions and exceptions in mail flow rules (also known as transport rules) to match text patterns in different parts of a message (for example, message headers, sender, recipients, subject, and the message body). Conditions and exceptions determine whether the action in the rule should be applied to an email message.
    • For your reference: Regular expressions in mail flow rules | Microsoft Learn.

    Please follow these steps and let me know the outcome. If the issue persists after completing the above, feel free to reach out, and we can further investigate the problem together.

    Thanks for choosing the MS community.

    Looking forward to your response and have a great day ahead!!

    Sincerely

    S M Nazmun Nur | Microsoft Community Moderator

    0 comments No comments