title: RegEx match replace help
body: <p>I am trying to do a regex match and replace for an .htaccess file but I can't quite figure out the replace bit. I think I have the match part right, but maybe someone can help.</p>
  
  <p>I have this url-
  <a href="http://www.foo.com/MountainCommunities/Lifestyles/5/VacationHomeRentals.aspx" rel="nofollow noreferrer">http://www.foo.com/MountainCommunities/Lifestyles/5/VacationHomeRentals.aspx</a></p>
  
  <p>And I'm trying to turn it into this-
  <a href="http://www.foo.com/mountain-lifestyle/Vacation-Home-Rentals.aspx" rel="nofollow noreferrer">http://www.foo.com/mountain-lifestyle/Vacation-Home-Rentals.aspx</a></p>
  
  <p>(MountainCommunities/Lifestyles)/\d/(.*)(.aspx)</p>
  
  <p>and then I figured I would have a rewrite rule starting like this-</p>
  
  <p>mountain-lifestyle/$2$3</p>
  
  <p>but I need to take what is in $2 in this instance and rewrite it to place dashes between the words with capital letters. Now I'm stumped.</p>