title: Regex to replace hyphen in the middle of a word
body: <p>I need a regex to replace hyphens in the middle of any word but not to touch leading or trailing ones or standalone ones. This is for use in .NET within Regex.Replace()</p>
  
  <p>I've tried the following </p>
  
  <pre><code>\w[-]\w
  </code></pre>
  
  <p>but that also captures the character either side of the hyphen. As an example, what I need is for the following string</p>
  
  <p>-test test-test -test</p>
  
  <p>If the replace character was !, to become</p>
  
  <p>-test test!test -test</p>
  
  <p>Any help greatly received</p>
  
  <p>Thanks</p>
  
  <p>James</p>