title: Regular Expressions in Office 365 Mail Flow Rule
body: <p>I'm attempting to use a regular expression mail flow rule to match inbound email pretending to be executives with my company, in Office 365 Exchange. However, I'm struggling to find what regex is accepted by the rule, and also make it broad enough to catch any domain.</p>
  
  <p>I have the following items set on a test rule:</p>
  
  <ul>
  <li>Apply this rule if... The sender is located - Outside the organization</li>
  <li>Generate incident report and send it to - me</li>
  <li>Priority = 1</li>
  <li>Audit this rule with severity level: Low (Enabled)</li>
  <li>Mode for this rule: Enforce</li>
  </ul>
  
  <p>As to the regex I am using the option "The sender address matches..." and assuming my test executive is "Foo Bar", the regex is </p>
  
  <pre><code>foo\s*bar.*@.*\.\w*
  </code></pre>
  
  <p>I created a gmail account "Foo Bar, foobar@gmail.com" and sent test emails to my work account, but I'm not getting an incident report sent to me.</p>
  
  <p>Is the issue with my regex, or some other setting in the Exchange rule?</p>