title: Negating the first occurrence of specific String using Regular Expression in java.
body: <p>In the code attached, I am trying to modify <strong>String toParse = "love love koo love love koo";</strong> and get the output  </p>
  
  <blockquote>
    <p>Result love love    Result love love </p>
  </blockquote>
  
  <p>But the pattern I am using </p>
  
  <blockquote>
    <p>love[^koo]*</p>
  </blockquote>
  
  <p>will give me the output Result </p>
  
  <blockquote>
    <p>Result love l Result love l</p>
  </blockquote>
  
  <p><strong>ie on the very first occurrence of 'k' or 'o' its splitting</strong>, 
  but my intention is on very first <strong>occurrence of "koo"</strong> it has to split, so that I will get the desired result. In short my intention is to create a pattern that will find till the first occurrence of <strong>"koo".</strong></p>
  
  <p>I have also attached my java code.</p>
  
  <pre><code>public static void main(String[] args) {
  
      // regular expression here
      Pattern pattern = Pattern.compile("love[^koo]*");
      // String here
      String toParse = "love love koo love love koo";
  
      Matcher matcher = pattern.matcher(toParse);
  
      boolean found = false;
      while (matcher.find()) {
  
          System.out.println("Result "
                  + toParse.substring(matcher.start(), matcher.end()));
          found = true;
      }
      if (!found) {
          // console.format("No match found.%n");
          System.out.println("No match found");
      }
  
  }
  </code></pre>