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 ^ # …

Read more

Java regex check alphanumeric string

The Alphanumericals are a combination of alphabetical [a-zA-Z] and numerical [0-9] characters, 62 characters. We can use below regex to match alphanumeric characters: ^[a-zA-Z0-9]+$ Regex explanation ^ # start string [a-z] # lowercase letters from a to z [A-Z] # uppercase letters from A to Z [0-9] # digits from 0 to 9 + # …

Read more