title: Java String Split / parsing issue using regular expression
body: <p>I have Stream of String data which could have value</p>
  
  <pre><code>system_id "2.2.2.1"
  component_id 6
  sequence_number 11
  timestamp 1459202982
  
  kv {
    key "val1"
  }
  kv {
    key "val2"
  }
  kv {
    key "val3"
  }
  
  system_id "2.2.2.1"
  component_id 6
  sequence_number 15
  timestamp 1459202982
  
  kv {
    key "val4"
  }
  kv {
    key "val5"
  } and so on....
  </code></pre>
  
  <p>All i am interested is value of key, which are val1, val2, val3....</p>
  
  <p>I am using scanner as shown below,</p>
  
  <pre><code>scan = new Scanner(new File("kvfiles/file1")).useDelimiter("\\s+kv\\s+\\{\\s+");  //To ignore any thing before "kv"
  
  while (scan.hasNext()) {
                  String str = scan.next();
                  finalString = str.split("\\s+\\}")[0];
  }
  </code></pre>
  
  <p>This code is working fine when file is started with "kv {" but in above case when file is started with below mention value, parser is giving error.</p>
  
  <pre><code>    system_id "2.2.2.1"
      component_id 6
      sequence_number 11
      timestamp 1459202982
  </code></pre>
  
  <p>Any idea how can i skip this block of data? </p>
  
  <p>Note: This block of data could come occasionally after some "kv { }" tags, all i need is to ignore it whenever it comes. </p>