title: Hashtag RegExp in Javascript breaks links with anchors and HTML entities
body: <p>I'm trying to parse hashtags in Javascript (node.js). I have some requirements for these hashtags: they can be written using cyrillic symbols, should not break HTML entities like <code>&amp;#039;</code> and links (<code>https://example.com/hacking#stage3</code>).</p>
  
  <p>I've read many examples on this site, but none worked for me: if one feature appears then other breaks. Now I'm stuck with URL filtering: negative lookahead doesn't work as I wish and links are still broken. This is my current regex:</p>
  
  <pre><code>(?!#[0-9])#([^#][a-zA-Z\d\u0400-\u04ff]+)
  </code></pre>
  
  <p>I'm testing it here: <a href="https://regex101.com/r/gN9fT3/4" rel="nofollow">https://regex101.com/r/gN9fT3/4</a>. It works partially: link is broken. How to fix it? What regex or JS feature I should use?</p>