Javaregex 简明教程

Java Regex - Examples Matching Characters

以下是使用 Java 中的正则表达式匹配字符的各种示例。

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

Sr.No

Construct & Matches

1

xThe character x

2

link:../javaregex/javaregex_characters_backslash.html[\\]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')