title: Why isn't `regex!` a wrapper for `Regex::new` to offer the same regex matching speed?
body: <p>The <a href="https://github.com/rust-lang/regex" rel="noreferrer">Rust Regex crate</a> offers the <code>regex!</code> syntax extension which makes it possible to compile a regex during the standard compile time. This is good in two ways:</p>
  
  <ul>
  <li>we don't need to do that work during runtime (better program performance)</li>
  <li>if our regex is malformed, the compiler can tell us during compilation instead of triggering a runtime panic</li>
  </ul>
  
  <p>Unfortunately, the docs say:</p>
  
  <blockquote>
    <p><strong>WARNING:</strong> The <code>regex!</code> compiler plugin is orders of magnitude slower than the normal <code>Regex::new(...)</code> usage. You should not use the compiler plugin unless you have a very special reason for doing so. </p>
  </blockquote>
  
  <p>This sounds like a completely different regex engine is used for <code>regex!</code> than for <code>Regex::new()</code>. Why isn't <code>regex!()</code> just a wrapper for <code>Regex::new()</code> to combine the advantages from both worlds? As I understand it, these syntax-extension compiler plugins can execute arbitrary code; why not <code>Regex::new()</code>?</p>