title: Regex to split on capital letters and numbers that are acronyms
body: <p>The following regex pattern splits strings on capital letters (eg. <code>GetDatabaseIDE</code> becomes <code>Get Database IDE</code>)</p>
  
  <pre><code>Regex.Matches("GetDatabaseIDE", @"([A-Z]+)([^A-Z])*").Cast&lt;Match&gt;().Select(m =&gt; m.Value);
  </code></pre>
  
  <p>How could this regex pattern be changed to include numbers and that still facilitates for the current return pattern? (eg. <code>GetDatabase2FA</code> should return <code>Get Database 2FA</code>)</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The desired regex pattern should split the strings like the following..</p>
  
  <pre><code>2FAGetDatabase ---&gt; 2FA Get Database
  
  Get2FADatabase ---&gt; Get 2FA Database
  
  GetDatabase2FA ---&gt; Get Database 2FA
  </code></pre>
  
  <p><strong>MY SOLUTION:</strong></p>
  
  <pre><code>public static string ToSentence(this string text)
  {
      string pattern;
      if (text.Any(char.IsDigit))
      {
          pattern = @"(?&lt;=[a-z])(?=[A-Z])|(?&lt;=[A-Z])(?=[A-Z][a-z])|(?&lt;=[a-z])(?=[0-9])";
          return string.Join(" ", Regex.Split(text, pattern));
      }
      else
      {
          pattern = @"([A-Z]+)([^A-Z])*";
          return string.Join(" ", Regex.Matches(text, @"([A-Z]+)([^A-Z])*").Cast&lt;Match&gt;().Select(m =&gt; m.Value));
      }
  }
  </code></pre>