/* 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
{
{
List
<String
> strs
= Arrays.
asList("123456",
"12345 ",
" 23456",
" 5",
// good "1 ", " ", " 2 ", " 2345 ", // good
"12 456", "1234 6", " 1 6", "1 6"); // bad
System.
out.
println(str.
matches("(?=.{6}$) *\\d* *"));
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnV0aWwucmVnZXguKjsKLyogTmFtZSBvZiB0aGUgY2xhc3MgaGFzIHRvIGJlICJNYWluIiBvbmx5IGlmIHRoZSBjbGFzcyBpcyBwdWJsaWMuICovCmNsYXNzIElkZW9uZQp7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KCXsKCQlMaXN0PFN0cmluZz4gc3RycyA9IEFycmF5cy5hc0xpc3QoIjEyMzQ1NiIsICIxMjM0NSAiLCAiIDIzNDU2IiwgIiAgICAgNSIsIC8vIGdvb2QKCQkiMSAgICAgIiwgIiAgICAgICIsICIgIDIgICAiLCAiIDIzNDUgIiwgIC8vIGdvb2QKCQkiMTIgNDU2IiwgIjEyMzQgNiIsICIgMSAgIDYiLCAiMSAgICA2Iik7IC8vIGJhZAoJCWZvciAoU3RyaW5nIHN0ciA6IHN0cnMpCgkJCVN5c3RlbS5vdXQucHJpbnRsbihzdHIubWF0Y2hlcygiKD89Lns2fSQpICpcXGQqICoiKSk7CgoJfQp9