title: Java regex string matching (like and not like)
body: <p>Lets say I have 3 strings</p>
  
  <pre><code>String string1 = "THE SUM OF TWO"
  String string2 = "HOT SUMMER"
  String string3 = "SUM IN SUMMER"
  </code></pre>
  
  <p>Now, I search for strings which have "SUM" and not "SUMMER".</p>
  
  <pre><code>String patt = ".*?SUM.*?"
  String notpatt = ".*?SUMMER.*?"
  Pattern regex = Pattern.complie(patt)
  Pattern nonregex = Pattern.complie(notpatt)
  </code></pre>
  
  <p>looping through each string here</p>
  
  <pre><code>if(regex.matcher(string1).matches()){
      if(nonregex.matcher(string1).matches()){
          System.out.println(false);
      }
      else{
          System.out.println(true);
      }
  }
  </code></pre>
  
  <p>Now, I need to get true for string3, where it has 'SUM' in it. But, as it also have 'SUMMER' it's giving me false.</p>
  
  <p>Is there any library that I can use? or 
  Is there any other way to get my expected result?</p>
  
  <p>Thanks,<br>
  Prithvi.</p>