Note: 1. [] represents the character set, does not represent the inclusion () Table capture and group Eg: can only be QQ mailbox/gmail mailbox/outlook Mailbox/163 mailbox One (qq|gmail|163) {1}\.com and [QQ] | ( Gmail) | (163)] \.com; the latter is wrong. Constructs a match character X character x\\ backslash character \0n with octal value 0 characters n (0 <= n <= 7) \0nn characters with octal value 0 nn (0 <= n <= 7) \0mnn characters with octal value 0 mnn (0 < = M <= 3, 0 <= n <= 7) \xhh character with hexadecimal value 0x hh\uhhhh character hhhh\t with hexadecimal value 0x tab (' \u0009 ') \ n New Line (newline) character (' \u000a ') \ r return (' \ \ u000d ') \f (' \u000c ') \a alarm (' "\u0007 ') \e escape character (' \u001b ') \cx the control characters class for x [Abc]a, B or C (simple Class) [^ABC] any character except A, B, or C (negation) [A-za-z]a to Z or A to Z, letters at both ends are included (range) [a-d[m-p]]a to D or M to P:[a-dm-p] (set) [A-z&&[def]]d, E, or F (intersection) [A-Z&&[^BC]] A to Z, except for B and C:[ad-z] (minus) [A-z&&[^m-p]]a to Z, not M to P:[a-lq-z] (minus) predefined character classes. Any character (which may or may not match the line terminator) \d number: [0-9]\d non-numeric: [^0 -9]\s whitespace character: [\t\n\x0b\f\r]\s non-whitespace character: [^\s]\w word character: [a-za-z_0-9]\w non-word character: [^\w] POSIX character class (Us-ascii only) \p{lower} lowercase alphabetic character: [a-z]\ P{upper} uppercase characters: [A-z]\p{ascii} All Ascii:[\x00-\x7f]\p{alpha} alphabetic characters: [\p{lower}\p{upper}]\p{digit} decimal digits: [0-9]\p{alnum } alphanumeric characters: [\p{alpha}\p{digit}]\p{punct}Punctuation:! " #$%& ' () *+,-./:;<=>[email protected][\]^_ ' {|} ~\p{graph} visible character: [\p{alnum}\p{punct}]\p{print} printable character: [\p{graph}\x20]\p{blank} Space or Tab: [\t]\p{cntrl} control character: [\x00-\x1f\ X7f]\p{xdigit} hexadecimal number: [0-9a-fa-f]\p{space} white space character: [\t\n\x0b\f\r] Java.lang.Character class (simple Java character type) \p{javalowercase} Equivalent to Java.lang.Character.isLowerCase () \p{javauppercase} equivalent to Java.lang.Character.isUpperCase () \p{javawhitespace} is equivalent to Java.lang.Character.isWhitespace () \p{javamirrored} is equivalent to Java.lang.Character.isMirrored () Unicode block and Class \p{ingreek} Greek Block (simple block) characters in \p{lu} capital letters (Simple category) \P{SC} currency symbol \p{ingreek} All characters, except in Greek block (negation) [\p{l}&&[^\p{lu}]] all letters, Except for uppercase letters (minus) the boundary match ^ line begins at the end of the \b Word boundary \b The non-word boundary \a The beginning of the input \g the end of the last matching \z input, only for the final terminator (if any) \z the end of the input greedy quantity word X? X, once or once also no x*x, 0 or more x+x, one or more x{n}x, exactly n times x{n,}x, at least n times x{n,m}x, at least n times, but not more than m reluctant number of words X?? X, no x* once or once? X, 0 times or multiple x+? X, one or more x{n}? X, exactly n times x{n,}? X, at least n times x{n,m}? X, at least n times, but not more than m possessive number of words x?+x, once or once there is no x*+x, 0 or more x++x, one or more x{n}+x, exactly n times x{n,}+x, at least n times x{n,m}+x, at least n times, but not more than m times LOgical operator XyX followed by yx| YX or Y (x) x, as the capture group back reference \ n Any matching nth capturing group reference \nothing, but refers to the following character \qnothing, but references all characters until \e\enothing, but ends the reference special construct (non-capture) starting from \q (?: X X, as a non-capturing group (? idmsux-idmsux) Nothing, but will match the flag i d M s u x on-off (? idmsux-idmsux:x) x, as with the given flag I d m s u x on-off (? =x) x, by 0 The width of the positive lookahead (?! x) x, through the 0 width of the negative lookahead (? <=x) x, through the 0 width of the positive lookbehind (? <! x) x, with a 0-width negative lookbehind (? >x) x, as a stand-alone, non-capturing group
Regular expression six: matching rules for Java SE