import java.util.regex.Matcher;
import java.util.regex.Pattern;
publicclass Main {
publicstaticvoid main(String[] argv) throws Exception {
Pattern end = Pattern.compile("\\G\\z");
Matcher mat = end.matcher("this is a test 999");
if (mat.find())
System.out.println(mat.group());
}
}