re = /\s(([a-zA-Z]+\-[a-zA-Z]+|[a-zA-Z]+)\.)/
str = '<p>With consumers becoming more and more health-conscious by the minute, the wearable fitness tracker market is ever-expanding.</p>
<p>So, to cut through the clutter, we created a lifestyle video series and an interactive kiosk experience at Best Buy, where we were able to inform and educate consumers about Jawbone’s Up products right there at point of sale.</p>
<p>By arming consumers with the knowledge on how to improve their personal physical fitness, they’re able to make informed decisions with the push of a button. As part of the experience, visually stimulating films helped people easily understand each product’s features and benefits as well as identify which product best fit their needs.</p>
<p>The lifestyle and product demonstration films within the interactive experience were also used across social media, the Jawbone website, and as TV spots in two countries.</p>
<div class="image"><a href="http://goldenarm.com/staging/wp-content/uploads/2015/06/UpKiosk.jpg"><img class="aligncenter wp-image-1156 size-large" src="http://goldenarm.com/staging/wp-content/uploads/2015/06/UpKiosk-1024x643.jpg" alt="" width="1024" height="643"></a><img class="aligncenter wp-image-1348 size-large" src="http://goldenarm.com/staging/wp-content/uploads/2015/06/6.-youpush-1600px-1024x576ABC.jpg" alt="" width="1024" height="576"></div>
<p class="work-page__video_container"><div class="video-embed"><iframe src="https://player.vimeo.com/video/122136552" width="500" height="281" frameborder="0" allowfullscreen="allowfullscreen"></iframe></div><br>
<div class="video-embed"><iframe src="https://player.vimeo.com/video/122136232" width="500" height="281" frameborder="0" allowfullscreen="allowfullscreen"></iframe></div></p>
<div class="image"><a style="font-size: 20px;" href="http://goldenarm.com/staging/wp-content/uploads/2015/06/Screen-Shot-2015-06-23-at-2.55.39-PM.png"><img class="alignnone size-full wp-image-857" src="http://goldenarm.com/staging/wp-content/uploads/2015/06/Screen-Shot-2015-06-23-at-2.55.39-PM.png" alt="Screen Shot 2015-06-23 at 2.55.39 PM" width="639" height="638"></a></div>'
subst = ' $1'
result = str.gsub(re, subst)
# Print the result of the substitution
puts result
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html