title: Regex matches in C# but not in java
body: <p>I have the following regex (long, I know):</p>
  
  <pre><code>(?-mix:((?-mix:(?-mix:\{\%).*?(?-mix:\%\})|(?-mix:\{\{).*?(?-mix:\}\}?))
  |(?-mix:\{\{|\{\%)))
  </code></pre>
  
  <p>that I'm using to split a string. It matches correctly in C#, but when I moved the code to Java, it doesn't match. Is there any particular feature of this regex that is C#-only?</p>
  
  <p>The source is produced as:</p>
  
  <pre><code>String source = Pattern.quote("{% assign foo = values %}.{{ foo[0] }}.");
  </code></pre>
  
  <p>While in C# it's:</p>
  
  <pre><code>string source = @"{% assign foo = values %}.{{ foo[0] }}.";
  </code></pre>
  
  <p>The C# version is like this:</p>
  
  <pre><code>string[] split = Regex.split(source, regex);
  </code></pre>
  
  <p>In Java I tried both:</p>
  
  <pre><code>String[] split = source.split(regex);
  </code></pre>
  
  <p>and also</p>
  
  <pre><code>Pattern p = Pattern.compile(regex);
  String[] split = p.split(source);
  </code></pre>