/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.regex.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
Pattern FALLBACK_MEN_SIZE_PATTERN = Pattern.compile("([0-9]*)([\\.[0-9]+]?)([^0-9]*)D\\([M|W]\\)\\s*US");
String strTest
= "9.5 D(M) US"; Matcher matcher = FALLBACK_MEN_SIZE_PATTERN.matcher(strTest);
if (matcher.find()) {
System.
out.
println(matcher.
group(1)); System.
out.
println(matcher.
group(2)); System.
out.
println(matcher.
group(3)); }
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnV0aWwucmVnZXguKjsKLyogTmFtZSBvZiB0aGUgY2xhc3MgaGFzIHRvIGJlICJNYWluIiBvbmx5IGlmIHRoZSBjbGFzcyBpcyBwdWJsaWMuICovCmNsYXNzIElkZW9uZQp7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KCXsKCQlQYXR0ZXJuIEZBTExCQUNLX01FTl9TSVpFX1BBVFRFUk4gPSBQYXR0ZXJuLmNvbXBpbGUoIihbMC05XSopKFtcXC5bMC05XStdPykoW14wLTldKilEXFwoW018V11cXClcXHMqVVMiKTsKICAgICAgICBTdHJpbmcgc3RyVGVzdCA9ICI5LjUgRChNKSBVUyI7CiAgICAgICAgTWF0Y2hlciBtYXRjaGVyID0gRkFMTEJBQ0tfTUVOX1NJWkVfUEFUVEVSTi5tYXRjaGVyKHN0clRlc3QpOwogICAgICAgIGlmIChtYXRjaGVyLmZpbmQoKSkgewogICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4obWF0Y2hlci5ncm91cCgxKSk7CiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihtYXRjaGVyLmdyb3VwKDIpKTsKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKG1hdGNoZXIuZ3JvdXAoMykpOwogICAgICAgIH0KICAgIH0KCQp9