import java.util.regex.Pattern;
class Test
{
public static void main
(String[] args
) {
final String regExp
= "[0-9]+([,.][0-9]{1,2})?"; final Pattern pattern = Pattern.compile(regExp);
System.
out.
println("1.05".
matches(regExp
) + ", " + pattern.
matches(regExp,
"1.123")); }
}
aW1wb3J0IGphdmEudXRpbC5yZWdleC5QYXR0ZXJuOwoKY2xhc3MgVGVzdAp7CiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKQogICAgewogICAgICAgIGZpbmFsIFN0cmluZyByZWdFeHAgPSAiWzAtOV0rKFssLl1bMC05XXsxLDJ9KT8iOwogICAgICAgIGZpbmFsIFBhdHRlcm4gcGF0dGVybiA9IFBhdHRlcm4uY29tcGlsZShyZWdFeHApOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiMS4wNSIubWF0Y2hlcyhyZWdFeHApICsgIiwgIiArIHBhdHRlcm4ubWF0Y2hlcyhyZWdFeHAsICIxLjEyMyIpKTsKICAgIH0KfQ==