Java regex to extract version
<p>I am trying to write a java regex to strip off java version from string I get from java -version command.</p>

<p>If the string is <code>"java version 1.7.0_17"</code> I need to extract 1.7 and 17 separately. Suppose if the string is <code>"java version 1.06_18"</code> I need to extract 1.06 and 18. Where first string should be only till the first decimal point. I tried with the below regex, </p>

<pre><code>Pattern p = Pattern.compile(".*\"(.+)_(.+)\"");
</code></pre>

<p>But it extracts only 1.7.0 and 17, but I not sure how to stop still one decimal point. Any help will be really appreciable.</p>
