English 中文(简体)
POSIX Character Classes
  • 时间:2024-11-05

Matching POSIX Character Classes


Previous Page Next Page  

Following are various examples of matching POSIX character classes using regular expression in java.

Sr.No Construct & Matches
1 p{Lower}

A lower-case alphabetic character: [a-z].

2 p{Upper}

An upper-case alphabetic character:[A-Z].

3 p{ASCII}

All ASCII:[x00-x7F].

4 p{Alpha}

An alphabetic character:[p{Lower}p{Upper}].

5 p{Digit}

A decimal digit: [0-9].

6 p{Alnum}

An alphanumeric character:[p{Alpha}p{Digit}].

7 p{Punct}

Punctuation: One of !"#$%& ()*+,-./:;<=>?@[]^_>{|}<.

8 p{Graph}

A visible character: [p{Alnum}p{Punct}].

9 p{Print}

A printable character: [p{Graph}x20].

10 p{Blank}

A space or a tab: [ ].

11 p{XDigit}

A hexadecimal digit: [0-9a-fA-F].

12 p{Space}

A whitespace character: [ x0Bf ].

Advertisements