Following are various examples of matching character classes using regular expression in java.
|Sr.No||Construct & Matches|
a, b, or c (simple class).
Any character except a, b, or c (negation).
a through z or A through Z, inclusive (range).
a through d, or m through p: [a-dm-p] (union).
d, e, or f (intersection).
a through z, except for b and c: [ad-z] (subtraction)
a through z, and not m through p: [a-lq-z](subtraction).