title: Regex to find and replace emoji names within colons
body: <p>I'm trying to write a regex (for JavaScript's regex engine) that I can use to do a find and replace in text for emoji names within colons. Like in Slack or Discord when you type <code>:smiley-face:</code> and it replaces it when you submit the chat. I'm targeting text nodes only so I don't need to worry about other html inside the text.</p>
  
  <p>Is it possible to write a regex that could match all of the following rules? (text highlighted with monospace blocks = regex positive matches)</p>
  
  <p><code>:any-non-whitespace:</code><br>
  <code>:text1:</code>sample2:<br>
  <code>:@(1@#$@SD:</code> <code>:s:</code><br>
  <code>:nospace::inbetween:</code> because there are 2 colons in the middle<br>
  <code>:nospace:</code>middle<code>:nospace:</code></p>
  
  <p>I'm starting with something like this but it's incomplete    </p>
  
  <pre><code>/:(?!:)\S+:/gim
  </code></pre>
  
  <p>I'm trying to think of all the special cases that might possibly occur doing this. Maybe I'm overthinking it.</p>
  
  <p>There's a lot of Twitch emotes involved so I can't use emoji unicode characters. The regex will find matches and replace with  tags</p>