I can’t stand it when a phrase set off in em dashes—like this—gets broken such that a line of text begins with an em dash. I’m not sure if that’s a recognized typographical sin or just my own pet peeve; either way, I use a lot of em dashes, so I decided to fix the problem.
The regex you want is:
/(\w+)(—|—|—)/
Which you can then replace with:
<span class="nobr">$1$2</span><wbr>
The <span> tags bind your em dashes to their preceding words, so that none may ever stab nakedly to the left.
January 2016, Berkeley
Really, the main thing to do here is sign up for my email newsletter. I try to make it feel like a note from a friend, and it’s very easy to unsubscribe. Plus, there are occasionally … S E C R E T S