I would like to validate some JSF's fields using Validators. I am searching for a pattern to validate a string which has only these characters:
AÁÂÄBCÇDEÉÈÊËFGHIÎÏJKLMNOÔÖPQRSTUÛÜÙVWXYZaàâäbcçdeéèêëfghiîïjklmnoôöpqrstuûüùvwxyÿz
I am using this pattern [A-Za-zÀ-ÿ]*\s\'\-
but it doesn't work:
My code:
public Boolean isValid(String str) throws PatternSyntaxException {
Pattern pattern = Pattern.compile("[A-Za-zÀ-ÿ]*\s\'\-");
Matcher matcher = pattern.matcher(str);
Boolean result = matcher.matches();
return result;
}