At the risk of answering the question you didn’t ask, may I suggest you don’t do this. If you find yourself performing regex matching against your text in order to achieve cosmetic changes, you’re probably making too much work for yourself and you will end up with code that’s hard to understand next year (or next week). I would suggest starting with a list and using css to make a single line when you need it.
<ul id="Thelist" class='category-static-links'>
<li><a href='#'>Blackjack</a> </li>
<li><a href='#'>Craps</a> </li>
<li><a href='#'>Poker</a></li>
<li><a href='#'>Roulette</a> </li>
<li><a href='#'>Slots</a></li>
</ul>
Then you can simply swap the class with jQuery (or vanilla javascript).
Here’s a quick, simple fiddle:
http://jsfiddle.net/markm/vbto9v5q/