Examples Matching Characters

Following are various examples of matching characters using regular expression in java.

Sr.NoConstruct & Matches
1xThe character x
2\\The backslash character
3\0nThe character with octal value 0n (0 ≤ n ≤ 7)
4\0nnThe character with octal value 0nn (0 ≤ n ≤ 7)
5\0mnnThe character with octal value 0mnn (0 ≤ m ≤ 3, 0 ≤ n ≤ 7)
6\xhhThe character with hexadecimal value 0xhh
7\uhhhhThe character with hexadecimal value 0xhhhh
8\tThe tab character (‘\u0009’)
9\nThe newline (line feed) character (‘\u000A’)
10\rThe carriage-return character (‘\u000D’)
11\fThe form-feed character (‘\u000C’)

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *