title: using lookahead and lookbehind with or ( | )
body: <p>I am trying to match some special characters that are not preceded and followed by a white space.</p>
  <p><a href="https://i.stack.imgur.com/P8WV6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/P8WV6.png" alt="enter image description here" /></a></p>
  <p>Normally the hyphen before the ww and the hyphen after the ww should match.</p>
  <p>This is the following regex I wrote:
  (?&lt;!\s)([.([]!):,+&quot;\/-])(?!\s)</p>
  <p>I tried this too:</p>
  <p><a href="https://i.stack.imgur.com/tYs4u.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tYs4u.png" alt="enter image description here" /></a></p>
  <p>((?&lt;!\s)|(?!\s))([.([]!):,+&quot;\/-])</p>
  <p>But the hyphen with the white space before and after also matches. (this should not be the case)</p>
  <p>Can you tell me what I'm doing wrong?
  Thank you for your help !</p>