String regEx="[`[email protected]#$%^&*()+=|{}‘:;‘,\\[\\].<>/?~!@#¥%……&*()——+|{}[]‘;:”“’。,、?]"; Pattern p = Pattern.compile(regEx); Matcher m = p.matcher(name); if( m.find()){ Toast.makeText(InputRegisterInfoActivity.this, "含不允许输入的特殊符号!", Toast.LENGTH_LONG).show(); }
时间: 2024-09-29 11:22:56