You need a regular expression that matches the class of all the letters. In all the scenarios of the world there are many of them, but, fortunately, we can say that the Java 6 RE engine that we are after writing will use the magic of Unicode classes to do the rest. In particular, the class L corresponds to all types of letters, upper, lower and "oh, this concept does not apply in my language":
Pattern p = Pattern.compile("^\\p{L}*$");
When reading docs, remember that backslashes need to be doubled if they are placed in a Java literal to stop the Java compiler from interpreting them as something else. (Also keep in mind that this RE is not suitable for things like checking people's names, which is a completely different and much more complex problem.)
source share