title: Difference between Pattern.quote() and its String concatenation equivalent?
body: <p>Consider the following pieces of code:</p>
  
  <pre><code>Pattern p = Pattern.compile(Pattern.quote("[r.e.g.e.x]"));
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Pattern p = Pattern.compile("\\Q" + "[r.e.g.e.x]" + "\\E");
  </code></pre>
  
  <p>As far as I know, they produce the exact same output. I know that the first is more easy to read, as stated in <a href="https://stackoverflow.com/a/15409355/6714194">this answer</a>. <em>But which approach is <strong>better</strong> or <strong>faster</strong>?</em></p>