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