1
你好不起作用怎么办正则表达式我要为AZ AZ0_9آ-ی(波斯)正则表达式android系统
String regex ="^(?:([a-z A-Z 0-9])||([آ-ی]))+$";
我不想让特殊字符,如!@#$%^ & *() ?> < + - 。
和我commllet代码是:如果你想允许正则表达式的空间变化结束
public int check_first_last_name(String name){
String regex ="^(?:([a-zA-Z0-9])||([آ-ی]))+$";
Matcher matcher = Pattern.compile(regex).matcher(name);
if (!matcher.find()){
return 2;
}
return 1;
}
'^(?:([A-ZA-Z0-9])|([آ-ی]) )+ $',''||应该是'|'和清晰度添加您的有效病例和无效的病例,并说明究竟你想 –
我修改的内容和修复我的错误。看看它 –