title: how to create regular expression based on some condition
body: <p>i want to create a regular expression to find and replace uppercase character based on some condition.</p>
  
  <p>find the starting uppercase for a group of uppercase character in a string and replace it lowercase and <code>*</code> before the starting uppercase.
  If there is any lowercase following the uppercase,replace the uppercase with lowercase and <code>*</code> before the starting uppercase. </p>
  
  <p><strong>input string</strong> : <code>stackOVERFlow</code></p>
  
  <p><strong>expected output</strong> :  <code>stack*over*flow</code></p>
  
  <p>i tried but could not get it working perfectly.</p>
  
  <p>Any idea on how to create a regular expression ? 
  Thanks</p>