title: Function to remove all Non-alpha-numeric characters, superscripts, and subscripts, except a dash '-'
body: <p>I need to create a T-SQL function that only keeps a hyphen (dash '-') and removes all non-alphanumeric characters (plus all spaces, superscripts and subscripts) from a given string. </p>
  
  <p>You can test Superscript/Subscripts in SSMS:</p>
  
  <pre><code>select  'Hello® World™ '
  </code></pre>
  
  <p><strong>Example:</strong></p>
  
  <p>input string<br>
  <a href="https://i.stack.imgur.com/ov2op.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ov2op.png" alt="enter image description here"></a></p>
  
  <p>output string:</p>
  
  <blockquote>
    <p>HelloWorld-ThisIsATest123</p>
  </blockquote>
  
  <p>Any solutions or thoughts will be appreciated.</p>