question: static double parseVersion ( String s ) { Matcher m = numPat . matcher ( s ) ; double res = 0.0 , f = 1 ; while ( m . find ( ) ) { res += Integer . parseInt ( m . group ( 1 ) ) * f ; f /= 1000 ; } return res ; }
target:  Given "1.2.3", will yield (1 + 2 / 1000 + 3 / 1000000)