Java regularization detects whether a string contains characters other than numbers or letters

java regular detects whether a string contains characters other than numbers or letters

that is, strings can only be letters or numbers, or alphanumeric combinations

[\ da-zA-Z] it doesn"t seem to work this way

Mar.21,2021

// *+
String reg = "^[\\da-zA-Z]*$";

// ;
String reg1 = "[^\\da-zA-Z]";
Menu