title: How do I force regex to match the longest possible part of the pattern.
body: <h3>I have a pattern  in .net and I want a string be matched with longest possible part of the pattern</h3>
  
  <pre><code>Pattern : "I (?&lt;a&gt;[\w\W]*)(want to match (?&lt;b&gt;longest))? available"
  or "I ((?&lt;a&gt;[\w\W]*)|(want to match (?&lt;b&gt;longest))?)+ available"
  </code></pre>
  
  <p>String : <b>"I want to match longest available"</b></p>
  
  <blockquote>
    <p>after match we have : <b>a="want to match longest" , b=""</b><br/>
    but i want : <b>a="" , b="longest"</b></p>
  </blockquote>