title: How to find matches that do not include a string in regular expressions
body: <p>I'm trying to create a regular expression that will match #rn: but not if it is followed by msg.</p>
  
  <p>So</p>
  
  <pre><code>#rn:abc -&gt; matches
  #rn:msh -&gt; matches
  #rn:xy -&gt; matches
  #rn:defg -&gt; matches
  #rn:msg - does not match
  </code></pre>
  
  <p>I have tried <code>\#rn\:[^m][^s][^g]</code> and <code>\#rn\:[^(msg)]</code> but they don't work.</p>
  
  <p>Can it be done?</p>