title: Split by Caps in Javascript
body: <p>I am trying to split up a string by caps using Javascript,</p>
  
  <p>Examples of what Im trying to do:</p>
  
  <pre><code>"HiMyNameIsBob"  -&gt;   "Hi My Name Is Bob"
  "GreetingsFriends" -&gt; "Greetings Friends"
  </code></pre>
  
  <p>I am aware of the <code>str.split()</code> method, however I am not sure how to make this function work with capital letters.</p>
  
  <p>I've tried:</p>
  
  <pre><code>str.split("(?=\\p{Upper})")
  </code></pre>
  
  <p>Unfortunately that doesn't work,
  any help would be great.</p>