Java: Boundary matchers

参考:Pattern
Boundary matchers

^   The beginning of a line
$   The end of a line
\b  A word boundary
\B  A non-word boundary
\A  The beginning of the input
\G  The end of the previous match
\Z  The end of the input but for the final terminator, if any
\z  The end of the input

Scanner中使用读取流的结束

 Scanner(istream, charsetName).useDelimiter("\\Z").next();

你可能感兴趣的:(Java: Boundary matchers)