title: What's Regular Expression for update Assembly build number in AssemblyInfo.cs file?
body: <p>Now, I'm writing VS 2008 Macro for replace Assembly version in AssemblyInfo.cs file. From MSDN, Assembly version must be wrote by using the following pattern.</p>
  
  <blockquote>
    <p>major.minor[.build[.revision]]</p>
  </blockquote>
  
  <p><strong>Example</strong></p>
  
  <ul>
  <li>1.0</li>
  <li>1.0.1234</li>
  <li>1.0.1234.0</li>
  </ul>
  
  <p>I need to dynamically generate build number for 'AssemblyInfo.cs' file and use Regular Expression for replace old build number with new generated build number.</p>
  
  <p>Do you have any Regular Expression for solving this question? Moreover, build number must not be contained in commented statement like below code. Finally, don't forget to check your regex for inline comment.</p>
  
  <p><strong>Don't replace any commented build number</strong></p>
  
  <pre><code>//[assembly: AssemblyVersion("0.1.0.0")]
  
  /*[assembly: AssemblyVersion("0.1.0.0")]*/
  
  /*
  [assembly: AssemblyTrademark("")]
  [assembly: AssemblyCulture("")]
  [assembly: ComVisible(false)]
  [assembly: AssemblyVersion("0.1.0.0")]
   */
  </code></pre>
  
  <p><strong>Replace build number that are not commented</strong></p>
  
  <pre><code>[assembly: AssemblyVersion("0.1.0.0")] // inline comment
  /* inline comment */ [assembly: AssemblyVersion("0.1.0.0")]
  [assembly: /*inline comment*/AssemblyVersion("0.1.0.0")]
  </code></pre>
  
  <p><strong>Hint.</strong> </p>
  
  <p>Please try your regex at <a href="http://gskinner.com/RegExr/" rel="nofollow noreferrer">Online Regular Expression Testing Tool</a></p>