Java Reference
In-Depth Information
Table 4-1. Regular expression metacharacter syntax
Subexpression
Matches
Notes
General
Start of line/string
\^
End of line/string
$
Word boundary
\b
Not a word boundary
\B
Beginning of entire string
\A
End of entire string
\z
End of entire string (except allowable final
line terminator)
See Matching Newlines in Text
\Z
.
Any one character (except line terminator)
“Character class”; any one character from
those listed
[…]
Any one character not from those listed
See Using regexes in Java: Test for
a Pattern
[\^…]
Alternation and Group-
ing
Grouping (capture groups)
See Finding the Matching Text
(…)
Alternation
|
(? :_ re _ )
Noncapturing parenthesis
End of the previous match
\G
Back-reference to capture group number " n "
\ n
Normal (greedy) quanti-
fiers
Search WWH ::




Custom Search