//System.out.println("check: " + name);
//System.out.println("post: " + postfix);
if (!name.endsWith(postfix)) {
return false;
}
//Look for a couple of digits next
int pos = name.length() - postfix.length();
//We have to find at least one digit... if not then this isn't what we want
if (!Character.isDigit(name.charAt(pos - 1))) {
return false;
}
pos--;
while (pos >= 1 && Character.isDigit(name.charAt(pos - 1))) {
//System.out.println("back one");
pos--;
}
//System.out.println("sub: " + name.substring(0, pos));
//Now want to check that we match the rest
return name.substring(0, pos).endsWith(prefix);