Java regex check non-alphanumeric string
The Alphanumericals are a combination of alphabetical [a-zA-Z] and numerical [0-9] characters, a total of 62 characters, and we can use regex [a-zA-Z0-9]+ to matches alphanumeric characters. If we want regex matches non-alphanumeric characters, prefix it with a negate symbol ^, meaning we want any characters that are not alphanumeric. ^[^a-zA-Z0-9]+$ Regex explanation ^ # …