title: Regular Expression Zero quantifier behaves differently on .NET and Mono
body: <p>I am trying to use a regular expression in C# to break up a string into up to 3 distinct parts, Left, Middle, Right.
  The expression pattern is built dynamically using input parameters to set the Left and Right quantifiers.
  In most cases where the quantifier is one or higher it works fine, however if the left and right quantifiers are set to zero, the behavior is different on .NET 3.5 on Windows and on Mono 2.01.9 on Suse.</p>
  
  <p>For example, using the following match string to test the string "1412":</p>
  
  <pre><code>^(?&lt;left&gt;.{0})(?&lt;mid&gt;.+)(?&lt;right&gt;.{0})
  </code></pre>
  
  <p>On Windows (.NET 3.5) the match groups show, as expected:</p>
  
  <pre><code>left:
  mid:   1412
  right:
  </code></pre>
  
  <p>On Suse (Mono 2.10.9) the match groups are:</p>
  
  <pre><code>left:   141
  mid:    2
  right:
  </code></pre>
  
  <p>Playing around with this, if I change the left and right quantifiers in the pattern to be non-greedy, I get the same (expected) result on both platforms:</p>
  
  <pre><code>^(?&lt;left&gt;.{0}?)(?&lt;mid&gt;.+)(?&lt;right&gt;.{0}?)
  
  left:
  mid:    1412
  right:
  </code></pre>
  
  <p>While this seems to solve the problem, this section of code is of critical importance to our application so I would like to understand why the behavior is different in the original pattern.</p>