title: How to separate known_hosts lines into four parts with stream
body: <p>I'm reading a "known_hosts" file with Java 8 stream.
  Here's is an example of a common line: </p>
  
  <pre><code>my_host,0.0.0.0 ssh-rsa xxxxxxxx
  </code></pre>
  
  <p>For each line, I want to separate it into 4 parts: (host, ip, key_type, key)</p>
  
  <p>But, I tried to look for a regex in Java and don't really know how it works.</p>
  
  <p>How do I solve this problem?</p>
  
  <pre><code>String knownHostsPath = "target/test/known_hosts";
      try (Stream&lt;String&gt; stream = Files.lines(Paths.get(knownHostsPath))) {
          stream.forEach(line -&gt; {
              line.split("*");
          }
          );  
  </code></pre>