title: split hostname and domain name from fqdn using regex
body: <p>I am working on regular expression. i.e java.google.com here "java" is hostname and "google.com" is domain name. Now I would like to extract from </p>
  
  <pre><code>String fqdn = "java.google.com";
  
  String hostname = "java";
  String domain = "google.com";
  </code></pre>
  
  <p>using regex. </p>
  
  <p>I tried like this </p>
  
  <pre><code>String text = "java.google.com";
  String extensionRemoved = text.split("\\.")[0];
  </code></pre>
  
  <p>I am getting result as java. But I want some regex which should give me "java" separate string and "google.com" separate String.</p>
  
  <p>I can use StringTokenizer but I don't want to use StringTokenizer as it effect performance If I have 1000,1,00,000 records from db. Thanks if any one gives efficient solution for this.</p>