Just replace any string that's all digits, like this:
myString.replaceAll("^[0-9]+$", "invalid");
According to comments, OP wants to replace any strings that don't have digits in them. here's the answer for that:
myString.replaceAll("^[^0-9]+$", "invalid");
Also, this will replace strings that do have some digits:
myString.replaceAll("^.*[0-9].*$", "invalid");