title: Split a String with multiple special Characters in it - Java
body: <pre><code>^((?!PATTERN).)*$
  </code></pre>
  
  <p>If the above string is given the output should be PATTERN.</p>
  
  <p>The special characters are the same for every input, only the words inside those special characters can be changed by the user.</p>
  
  <p>When i do a split i get an Unclosed group near index 6 Exception.</p>
  
  <pre><code>String test = "^((?!PATT).)*$";
  String patternOne = "^((?!";
  String patternTwo = ").)*$";
  if(test.contains(patternOne) &amp;&amp; test.contains(patternTwo))
  {
    test = test.split(patternOne)[1];
    test = test.split(patternTwo)[0];
  }
  </code></pre>