July 2017
Intermediate to advanced
158 pages
3h 41m
English
Java also supports many POSIX character classes for matching ASCII text. Here is the list:
| POSIX Character Class | Meaning | Character Class |
| \p{ASCII} | All ASCII characters | [\x00-\x7F] |
| \p{Digit} | Any digit | [0-9] |
| \p{Lower} | Lowercase alphabets | [a-z] |
| \p{Upper} | Uppercase alphabets | [A-Z] |
| \p{Alpha} | Any alphabet | [\p{Lower}\p{Upper}] |
| \p{Alnum} | Any alpha-numeric character | [\p{Lower}p{Upper}\p{Digit}] |
| \p{Punct} | A punctuation character | [!"\#$%&'()*+,-./:;<=>?@\[\\\]^_`{|}~] |
| \p{Blank} | Space or tab | [ \t] |
| \p{Space} | A whitespace character | [ \t\n\x0B\f\r] |
| \p{Graph} | A visible ASCII character | [\p{Alnum}\p{Punct}] |
| \p{Print} | A printable character | [\p{Graph}\x20] |
| \p{Cntrl} | A control character | [\x00-\x1F\x7F] |
| \p{XDigit} ... |
Read now
Unlock full access