Hello,
i put the below on an input text in my page :
^[A-Z a-z\u0600-\u06FF][^@/\\]{8,19}
but an error shown is that
java util regex patternsyntaxexception unclosed character class near index 33
i tried to do it in java like :
public void myValidator(FacesContext facesContext,UIComponent uIComponent, Object object) {
if(object!=null){
String name=object.toString();
String expression="^[A-Z a-zu0600-u06FF][^@/\\]{8,19}";
CharSequence inputStr=name;
Pattern pattern=Pattern.compile(expression.replaceAll("[\\[\\]]", ""));
Matcher matcher=pattern.matcher(inputStr);
String msg="New Password is not in Proper Format";
if(matcher.matches()){
}
else{
throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,msg,null));
}
}
}
but it is not the syntax that i want,it always prints
New Password is not in Proper Format
how can i do it please.
Thanks