title: Google Test - Test that a string does not contain a string
body: <p>Using Google Test, I need a way to verify that a string that was returned by my class under test does not contain a particular string. I can currently test that a string does contain another string by using EXPECT_THAT and MatchesRegex; however, I don't know how to build a valid POSIX Extended regular expression for not containing a word, and I don't know how to negate a MatchesRegex call.</p>
  
  <p>I tried doing a regex I found here on SO: </p>
  
  <pre><code>EXPECT_THAT(returnedString, MatchesRegex("^(?!.*badword).*$"));
  </code></pre>
  
  <p>but that gives me an error:</p>
  
  <pre><code>Regular expression "^(?!.*badword).*$" is not a valid POSIX Extended regular expression.
  </code></pre>
  
  <p>Any other suggestions on how I could do this?</p>