title: Regular expression matching everything except a given regular expression
body: <p>I am trying to figure out a regular expression which matches any string that doesn't start with mpeg. A generalization of this is matching any string which doesn't start with a given regular expression.</p>
  
  <p>I tried something like as follows:</p>
  
  <pre><code>[^m][^p][^e][^g].* 
  </code></pre>
  
  <p>The problem with this is that it requires at least 4 characters to be present in the string. I was not able to figure out a good way to handle this and a generalized way to handle this in a general purpose manner. </p>
  
  <p>I will be using this in Python. </p>