Matching Unicode Character Classes


Advertisements

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

Sr.No Construct & Matches
1 \p{IsLatin}

A Latin script character.

2 \p{InGreek}

A character in the Greek block.

3 \p{Lu}

An uppercase letter.

4 \p{IsAlphabetic}

An alphabetic character (binary property).

5 \p{Sc}

A currency symbol.

6 \P{InGreek}

Any character except one in the Greek block.

7 [\p{L}&&[^\p{Lu}]]

Any letter except an uppercase letter.

Advertisements