Используйте шаблон с границами слов :
String str = "I am in the EU."; if (str.matches(".*\\bEU\\b.*")) doSomething();
Взгляните на документы для Pattern .
Pattern