title: Regex expression works, but not in JAVA regex library?
body: <p>I'm trying to find this regular expression:</p>
  
  <pre><code>&lt;ac:structured-macro ac:macro-id="........-....-....-....-............" ac:name="asd" ac:schema-version="."&gt;&lt;ac:parameter ac:name="atlassian-macro-output-type"&gt;INLINE&lt;/ac:parameter&gt;&lt;ac:plain-text-body&gt;&lt;!\[CDATA\[[^&lt;]*&lt;/ac:plain-text-body&gt;&lt;/ac:structured-macro&gt;
  </code></pre>
  
  <p>It works fine when I test with data in websites such as <a href="http://www.regexr.com/" rel="nofollow">http://www.regexr.com/</a> and <a href="https://regex101.com/" rel="nofollow">https://regex101.com/</a>, but does not on THE SAME data, when I try using it inside my Java servlet. </p>
  
  <p>I had to modify the above expression, to give it as String value into a function, to this:</p>
  
  <pre><code>String regexExp="&lt;ac:structured-macro ac:macro-id=\"........-....-....-....-............\" ac:name=\"asd\" ac:schema-version=\".\"&gt;&lt;ac:parameter ac:name=\"atlassian-macro-output-type\"&gt;INLINE&lt;\\/ac:parameter&gt;&lt;ac:plain-text-body&gt;&lt;!\\[CDATA\\[[^&lt;]*&lt;/ac:plain-text-body&gt;&lt;/ac:structured-macro&gt;";
  </code></pre>
  
  <p>And now, this does not work to find my matches! Can you help? All I did was to change " to \" and \[ to \\[ to make Java String accept my value!</p>