I came across an interesting defect today the issue is I have a deployment of my web application in Russia and the name value “Наталья” is not returning true as alphaNumeric in the method below. Curious for some input on how people would approach a problem like this! – Duncan
private boolean isAlphaNumeric(String str) {
return str.matches("[\\w-']+");
}
You have to use Unicode regex . for example
\p{L}+for any unicode letter. For more look in the java doc forjava.util.Patternthere is section called unicode support. Also, there are details here: link