title: Regex optional capturing group?
body: <p>After hours of searching I decided to ask this question. Why doesn't this regular expression <code>^(dog).+?(cat)?</code> work as I think it should work (i.e. capture the first dog and cat if there is any)? What am I missing here?</p>
  
  <pre><code>dog, cat
  dog, dog, cat
  dog, dog, dog
  </code></pre>