P ("\n\r\t". Matches ("\\s{4}");//true name \s whitespace character: [\t\n\x0b\f\r] P ("". Matches ("\\s"));//false description \s Non-white-space characters: [ ^\s] so is false p ("A_8". Matches ("\\w{3}")),//true p ("abc888&^%". Matches ("[a-z]{1,3}\\d+[&^#%]+")); A true description [a-z]{1,3} represents a character that appears three times, \\d+ number appears one or more of the four inside brackets in the &^#%]+, or write P ("abc888&^%"). Matches ("[A-Z ]{3}\\d{3}[&^%]+ "));//true p (" \ R ") (" \\\\ ");//true note that the previous refers to a \//p (" \ ". Matches (" \ ")); The face of the two is not correct, prompted unexpected internal error near index 1. Incorrect syntax//Note \\p{upper} or \\p{lower} can only judge one character, not the string P ("a". Matches ("\\p{lower}"));//true description \p{lower} lowercase alphabetic characters: [A-Z ] P ("Dafdsfad". Matches ("\\w{2,}"));//true p ("Dafdsafad". Matches ("[a-z]+"));//false p ("Dafdsfad". M Atches ("[a-z]+"));//true//can match lowercase strings in the following way, of course, because [a-z]+ itself represents more than one lowercase letter p ("DAFDSFADDFDSF". Matches ("[a-z& amp;&\\p{lower}]+ "));//true p (" A ". Matches (" \\p{lower} "));//false p (" AA ". MaTches ("\\p{lower}"));//false p ("AA". Matches ("\\p{lower}\\p{upper}"));//true p ("A". Matches ("\\p{upper}")); /true Description \p{upper} uppercase characters: [A-z] p ("AB". Matches ("\\p{upper}");//false p ("AB". Matches ("\\p{upper}\\p{lower}" );//true p ("". Matches ("\\p{space}")); True \p{space} whitespace characters: [\t\n\x0b\f\r]