I'm using the following Regular Expression: [a-zA-Z]+ to detect if a string contains text but this fails in Java 1.7. It does work in Notepad++. What am I missing?
String message = "123 foo 567";
if (message.matches("[a-zA-Z]+")) {
System.out.println("Success");
} else
System.out.println("Fail");
"foo" --> Success
"123 foo" --> Fail
"foo 456" --> fail