title: What is the use of Pattern.quote method?
body: <p>I'm trying to understand <code>Pattern.quote</code> using the following code:</p>
  <pre><code>String pattern = Pattern.quote(&quot;1252343% 8 567 hdfg gf^$545&quot;);
  System.out.println(&quot;Pattern is : &quot;+pattern);
  </code></pre>
  <p>produces the output:</p>
  <pre><code>Pattern is : \Q1252343% 8 567 hdfg gf^$545\E
  </code></pre>
  <p>What are <code>\Q</code> and <code>\E</code> here? The documentation description says :</p>
  <blockquote>
  <p>Returns a literal pattern <code>String</code> for the specified <code>String</code>.</p>
  <p>This method produces a <code>String</code> that can be used to create a <code>Pattern</code> that would match the string <code>s</code> as if it were a literal pattern.</p>
  <p>Metacharacters or escape sequences in the input sequence will be given no special meaning.</p>
  </blockquote>
  <p>But <code>Pattern.quote</code>'s return type is <code>String</code> and not a compiled <code>Pattern</code> object.</p>
  <p>Why is this method required and what are some usage examples?</p>