Special characters validation

For any field if you want throw any exception when entered any special characters.  We need to use following pattern to find.

Pattern p = Pattern.compile(“[^a-zA-Z0-9\\s]”);

Recent Posts