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

Matching Predefined Character Classes


Previous Page Next Page  

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

Sr.No Construct & Matches
1 .

Any character (may or may not match pne terminators).

2 d

A digit: [0-9].

3 D

A non-digit: [^0-9].

4 s

A whitespace character: [ x0Bf ]

5 S

A non-whitespace character: [^s].

6 w

A word character: [a-zA-Z_0-9].

7 W

A non-word character: [^w]

Advertisements