title: Vim capturing groups regex to replace camel case string with blank space at the end
body: <p>I have line of code like this one:</p>
  
  <pre><code>variableInCamelCase &lt;- map["variableInCamelCase"]
  </code></pre>
  
  <p>I need to make it like this:</p>
  
  <pre><code>variable_In_Camel_Case &lt;- map["variableInCameCase"]
  </code></pre>
  
  <p>Only the first word must be converted, I'm trying to find a regex to do it, and I need to do it in Vim but I can't.
  A regex like this one:</p>
  
  <pre><code>var rex = /([A-Z])([A-Z])([a-z])|([a-z])([A-Z])/g;
  
  "CSVFilesAreCoolButTXT".replace( rex, '$1$4_$2$3$5' );
  </code></pre>
  
  <p>Is not good because I need to do it only on the first word. Plus, I need it for VIM which uses a special syntax to capture a group.</p>
  
  <p>I tried something like this: <code>s/\(\l\)\(\u\)/\1_\2/g</code>, which is equivalent to <code>([a-z])([A-Z])</code>, but I can't put it in OR with the <code>([A-Z])([A-Z])([a-z])</code></p>
  
  <p>There is someone with a good vim ready regex for my problem? An explanation would be welcome also.</p>