An apology for my bad English, I\'m using google translate.
I\'m creating an activity in which users must create a new profile. I put a limit to edit text of 15 char
If you want to pick up the special chars and support more than just the very resrictive set of English alpha bet and numbers:
String edit_text_name = YourEditTextName.getText().toString();
Pattern regex = Pattern.compile("[$&+,:;=\\\\?@#|/'<>.^*()%!-]");
if (regex.matcher(edit_text_name).find()) {
Log.d(TAG, "SPECIAL CHARS FOUND");
//handle your action here toast message/ snackbar or something else
return;
}