title: Perl: Matching string not containing PATTERN
body: <p>While using Perl regex to chop a string down into usable pieces I had the need to match everything except a certain pattern. I solved it after I found this hint on <a href="http://www.perlmonks.org/?node_id=188907" rel="noreferrer">Perl Monks</a>:</p>
  
  <pre><code>/^(?:(?!PATTERN).)*$/;    # Matches strings not containing PATTERN
  </code></pre>
  
  <p>Although I solved my initial problem, I have little clue about how it actually works. I checked <a href="http://linuxcommand.org/man_pages/perlre1.html" rel="noreferrer">perlre</a>, but it is a bit too formal to grasp.</p>
  
  <p><a href="https://stackoverflow.com/questions/406230/regular-expression-to-match-string-not-containing-a-word">Regular expression to match a line that doesn&#39;t contain a word?</a> helps a lot in understanding, but why is the <code>.</code> in my example and the <code>?:</code> and how do the outer parentheses work? </p>
  
  <p>Can someone break up the regex and explain in simple words how it works?</p>