title: Regex find instance of dash, but not <space>dash<space>
body: <p>I am sooo close. I am trying code a regex expression for Notepad++ to replace a dash with a space, <em>ignoring</em> dashes already with a pre/post space. I realize I could search/replace " - " with "foobarfoo" then search for "-" replacing for " " then converting "foobarfoo" back to " - ", but damnit - I'm trying to learn regex!</p>
  
  <p>Here's my problem:</p>
  
  <blockquote>
    <p>Adapter - BNC Male to BNC-Female, Right Angle</p>
  </blockquote>
  
  <p>to</p>
  
  <blockquote>
    <p>Adapter - BNC Male to BNC Female, Right Angle</p>
  </blockquote>
  
  <p>(note the disappearing dash in "BNC Female")</p>
  
  <p>The closest I am getting is using this:
  <code>/(?:[^( )])\-(?:[^( )])/g</code></p>
  
  <p>but that results with it finding the single letter ahead, the dash, and the single letter following:</p>
  
  <blockquote>
    <p>Adapter - BNC Male to BN<strong>C-F</strong>emale, Right Angle</p>
  </blockquote>
  
  <p>WHY is it selecting the pre/post characters? Is this not:</p>
  
  <p><code>(?:[^( )])</code>  find anything except a space (as a noncapturing group)...</p>
  
  <p><code>\-</code>      ... that follows with a dash ...</p>
  
  <p><code>(?:[^( )])</code>  ... and is followed by anything except a space(as a noncapturing group)</p>
  
  <p>I get even closer is I replace the first term with <code>(?=[^( )])</code> but if I change the third term to <code>(?![^( )])</code> I'm back to where I started - just selecting the dash in between the two spaces. GRRRR.</p>
  
  <p>More samples here at <a href="http://regexr.com/444i2" rel="nofollow noreferrer">http://regexr.com/444i2</a></p>