title: Java escaping regex meta characters and constrct
body: <p>I am trying to form regex pattern from a string containing non meta-characters - <code>(%, &amp;)</code> and meta characters - <code>([, ], {, },|)</code>.</p>
  
  <p>Question is, I want to(how to) identify any character that is potential meta character of java Pattern and escape it using <code>"\\"</code> and then I can replace some of non meta characters with regex meta character <code>.*</code> or <code>.+</code>
  e.g. input string = "%abc&amp;xy[z,p)"
  1st step output( where I need help to identify and escape all meta char) - "%abc&amp;xy\\[z,p\\)"
  2nd setp output( where I would do custom char replacement(no help needed here)) - ".*abc.+\\[z,p\\)"</p>
  
  <p>p.s. - I don't think <code>Pattern.quote()</code> or <code>Pattern.Literal</code> is answer here. As of now only option I see is to have map of those meta chars and inspect each character against it.</p>