title: POSIX BRE syntax for a negative look ahead/not followed by
body: <p>I'm trying to create an email validation with some exclusions. Basically, ignore email addresses with this format, filtering out all City Governments and Schools:
  <code>user@ci...us</code> and <code>user@..[a-z]{2}.us</code></p>
  
  <p><a href="https://stackoverflow.com/a/34625320/7606730">This solution</a> mentions negated character classes [^], alternation |, and the end of string anchor $. How can I rewrite the following, which works without any look ahead?</p>
  
  <pre><code>[a-zA-Z_0-9.-]+&lt;@[a-zA-Z_0-9-]+?\.+[a-zA-Z_0-9.-]+?\.(us|info|to|br|bid|cn|ru)
  </code></pre>
  
  <p>Using a few of the regex validators this works using a standard look ahead:</p>
  
  <pre><code>(?!.*\@ci\..+?\.us$)(?!.*\@*\..+?\.ca.us$)([a-zA-Z_0-9.-]+@[a-zA-Z_0-9-]+?\.+[a-zA-Z_0-9.-]+?\.(us|info|to|br|bid|cn|ru)
  </code></pre>
  
  <p>My first attempts led me to this solution which only partially handle the 1st look ahead (I tightened the top level domain with the word boundary <code>\b</code>:</p>
  
  <pre><code>[a-zA-Z_0-9.-]+&lt;@([^c"][^"]+|c[^i"][^+]+|ci[^i"][^i"])[a-zA-Z_0-9-]+?\.+[a-zA-Z_0-9.-]+?\.(\bus\b|\binfo\b|\bto\b|\bbr\b|\bbid\b|\bcn\b|\bru\b|\bu\b)
  </code></pre>