提交 335f51e9 编写于 作者: D darcy

8020095: Fix doclint warnings in java.util.regex

Reviewed-by: mchung
上级 4d81c909
/* /*
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -77,7 +77,7 @@ public interface MatchResult { ...@@ -77,7 +77,7 @@ public interface MatchResult {
public int start(int group); public int start(int group);
/** /**
* Returns the offset after the last character matched. </p> * Returns the offset after the last character matched.
* *
* @return The offset after the last character matched * @return The offset after the last character matched
* *
......
/* /*
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -28,8 +28,8 @@ package java.util.regex; ...@@ -28,8 +28,8 @@ package java.util.regex;
import java.util.Objects; import java.util.Objects;
/** /**
* An engine that performs match operations on a {@link java.lang.CharSequence * An engine that performs match operations on a {@linkplain java.lang.CharSequence
* </code>character sequence<code>} by interpreting a {@link Pattern}. * character sequence} by interpreting a {@link Pattern}.
* *
* <p> A matcher is created from a pattern by invoking the pattern's {@link * <p> A matcher is created from a pattern by invoking the pattern's {@link
* Pattern#matcher matcher} method. Once created, a matcher can be used to * Pattern#matcher matcher} method. Once created, a matcher can be used to
...@@ -330,7 +330,7 @@ public final class Matcher implements MatchResult { ...@@ -330,7 +330,7 @@ public final class Matcher implements MatchResult {
} }
/** /**
* Returns the start index of the previous match. </p> * Returns the start index of the previous match.
* *
* @return The index of the first character matched * @return The index of the first character matched
* *
...@@ -402,7 +402,7 @@ public final class Matcher implements MatchResult { ...@@ -402,7 +402,7 @@ public final class Matcher implements MatchResult {
} }
/** /**
* Returns the offset after the last character matched. </p> * Returns the offset after the last character matched.
* *
* @return The offset after the last character matched * @return The offset after the last character matched
* *
...@@ -647,6 +647,7 @@ public final class Matcher implements MatchResult { ...@@ -647,6 +647,7 @@ public final class Matcher implements MatchResult {
* invocations of the {@link #find()} method will start at the first * invocations of the {@link #find()} method will start at the first
* character not matched by this match. </p> * character not matched by this match. </p>
* *
* @param start the index to start searching for a match
* @throws IndexOutOfBoundsException * @throws IndexOutOfBoundsException
* If start is less than zero or if start is greater than the * If start is less than zero or if start is greater than the
* length of the input sequence. * length of the input sequence.
...@@ -736,8 +737,8 @@ public final class Matcher implements MatchResult { ...@@ -736,8 +737,8 @@ public final class Matcher implements MatchResult {
* captured during the previous match: Each occurrence of * captured during the previous match: Each occurrence of
* <tt>${</tt><i>name</i><tt>}</tt> or <tt>$</tt><i>g</i> * <tt>${</tt><i>name</i><tt>}</tt> or <tt>$</tt><i>g</i>
* will be replaced by the result of evaluating the corresponding * will be replaced by the result of evaluating the corresponding
* {@link #group(String) group(name)} or {@link #group(int) group(g)</tt>} * {@link #group(String) group(name)} or {@link #group(int) group(g)}
* respectively. For <tt>$</tt><i>g</i><tt></tt>, * respectively. For <tt>$</tt><i>g</i>,
* the first number after the <tt>$</tt> is always treated as part of * the first number after the <tt>$</tt> is always treated as part of
* the group reference. Subsequent numbers are incorporated into g if * the group reference. Subsequent numbers are incorporated into g if
* they would form a legal group reference. Only the numerals '0' * they would form a legal group reference. Only the numerals '0'
......
...@@ -45,8 +45,8 @@ import java.util.stream.StreamSupport; ...@@ -45,8 +45,8 @@ import java.util.stream.StreamSupport;
* *
* <p> A regular expression, specified as a string, must first be compiled into * <p> A regular expression, specified as a string, must first be compiled into
* an instance of this class. The resulting pattern can then be used to create * an instance of this class. The resulting pattern can then be used to create
* a {@link Matcher} object that can match arbitrary {@link * a {@link Matcher} object that can match arbitrary {@linkplain
* java.lang.CharSequence </code>character sequences<code>} against the regular * java.lang.CharSequence character sequences} against the regular
* expression. All of the state involved in performing a match resides in the * expression. All of the state involved in performing a match resides in the
* matcher, so many matchers can share the same pattern. * matcher, so many matchers can share the same pattern.
* *
...@@ -73,15 +73,14 @@ import java.util.stream.StreamSupport; ...@@ -73,15 +73,14 @@ import java.util.stream.StreamSupport;
* such use. * such use.
* *
* *
* <a name="sum"> * <h3><a name="sum">Summary of regular-expression constructs</a></h3>
* <h4> Summary of regular-expression constructs </h4>
* *
* <table border="0" cellpadding="1" cellspacing="0" * <table border="0" cellpadding="1" cellspacing="0"
* summary="Regular expression constructs, and what they match"> * summary="Regular expression constructs, and what they match">
* *
* <tr align="left"> * <tr align="left">
* <th bgcolor="#CCCCFF" align="left" id="construct">Construct</th> * <th align="left" id="construct">Construct</th>
* <th bgcolor="#CCCCFF" align="left" id="matches">Matches</th> * <th align="left" id="matches">Matches</th>
* </tr> * </tr>
* *
* <tr><th>&nbsp;</th></tr> * <tr><th>&nbsp;</th></tr>
...@@ -128,24 +127,24 @@ import java.util.stream.StreamSupport; ...@@ -128,24 +127,24 @@ import java.util.stream.StreamSupport;
* <tr><th>&nbsp;</th></tr> * <tr><th>&nbsp;</th></tr>
* <tr align="left"><th colspan="2" id="classes">Character classes</th></tr> * <tr align="left"><th colspan="2" id="classes">Character classes</th></tr>
* *
* <tr><td valign="top" headers="construct classes"><tt>[abc]</tt></td> * <tr><td valign="top" headers="construct classes">{@code [abc]}</td>
* <td headers="matches"><tt>a</tt>, <tt>b</tt>, or <tt>c</tt> (simple class)</td></tr> * <td headers="matches">{@code a}, {@code b}, or {@code c} (simple class)</td></tr>
* <tr><td valign="top" headers="construct classes"><tt>[^abc]</tt></td> * <tr><td valign="top" headers="construct classes">{@code [^abc]}</td>
* <td headers="matches">Any character except <tt>a</tt>, <tt>b</tt>, or <tt>c</tt> (negation)</td></tr> * <td headers="matches">Any character except {@code a}, {@code b}, or {@code c} (negation)</td></tr>
* <tr><td valign="top" headers="construct classes"><tt>[a-zA-Z]</tt></td> * <tr><td valign="top" headers="construct classes">{@code [a-zA-Z]}</td>
* <td headers="matches"><tt>a</tt> through <tt>z</tt> * <td headers="matches">{@code a} through {@code z}
* or <tt>A</tt> through <tt>Z</tt>, inclusive (range)</td></tr> * or {@code A} through {@code Z}, inclusive (range)</td></tr>
* <tr><td valign="top" headers="construct classes"><tt>[a-d[m-p]]</tt></td> * <tr><td valign="top" headers="construct classes">{@code [a-d[m-p]]}</td>
* <td headers="matches"><tt>a</tt> through <tt>d</tt>, * <td headers="matches">{@code a} through {@code d},
* or <tt>m</tt> through <tt>p</tt>: <tt>[a-dm-p]</tt> (union)</td></tr> * or {@code m} through {@code p}: {@code [a-dm-p]} (union)</td></tr>
* <tr><td valign="top" headers="construct classes"><tt>[a-z&&[def]]</tt></td> * <tr><td valign="top" headers="construct classes">{@code [a-z&&[def]]}</td>
* <td headers="matches"><tt>d</tt>, <tt>e</tt>, or <tt>f</tt> (intersection)</tr> * <td headers="matches">{@code d}, {@code e}, or {@code f} (intersection)</tr>
* <tr><td valign="top" headers="construct classes"><tt>[a-z&&[^bc]]</tt></td> * <tr><td valign="top" headers="construct classes">{@code [a-z&&[^bc]]}</td>
* <td headers="matches"><tt>a</tt> through <tt>z</tt>, * <td headers="matches">{@code a} through {@code z},
* except for <tt>b</tt> and <tt>c</tt>: <tt>[ad-z]</tt> (subtraction)</td></tr> * except for {@code b} and {@code c}: {@code [ad-z]} (subtraction)</td></tr>
* <tr><td valign="top" headers="construct classes"><tt>[a-z&&[^m-p]]</tt></td> * <tr><td valign="top" headers="construct classes">{@code [a-z&&[^m-p]]}</td>
* <td headers="matches"><tt>a</tt> through <tt>z</tt>, * <td headers="matches">{@code a} through {@code z},
* and not <tt>m</tt> through <tt>p</tt>: <tt>[a-lq-z]</tt>(subtraction)</td></tr> * and not {@code m} through {@code p}: {@code [a-lq-z]}(subtraction)</td></tr>
* <tr><th>&nbsp;</th></tr> * <tr><th>&nbsp;</th></tr>
* *
* <tr align="left"><th colspan="2" id="predef">Predefined character classes</th></tr> * <tr align="left"><th colspan="2" id="predef">Predefined character classes</th></tr>
...@@ -175,36 +174,36 @@ import java.util.stream.StreamSupport; ...@@ -175,36 +174,36 @@ import java.util.stream.StreamSupport;
* <tr><td valign="top" headers="construct predef"><tt>\W</tt></td> * <tr><td valign="top" headers="construct predef"><tt>\W</tt></td>
* <td headers="matches">A non-word character: <tt>[^\w]</tt></td></tr> * <td headers="matches">A non-word character: <tt>[^\w]</tt></td></tr>
* <tr><th>&nbsp;</th></tr> * <tr><th>&nbsp;</th></tr>
* <tr align="left"><th colspan="2" id="posix">POSIX character classes</b> (US-ASCII only)<b></th></tr> * <tr align="left"><th colspan="2" id="posix"><b>POSIX character classes (US-ASCII only)</b></th></tr>
* *
* <tr><td valign="top" headers="construct posix"><tt>\p{Lower}</tt></td> * <tr><td valign="top" headers="construct posix">{@code \p{Lower}}</td>
* <td headers="matches">A lower-case alphabetic character: <tt>[a-z]</tt></td></tr> * <td headers="matches">A lower-case alphabetic character: {@code [a-z]}</td></tr>
* <tr><td valign="top" headers="construct posix"><tt>\p{Upper}</tt></td> * <tr><td valign="top" headers="construct posix">{@code \p{Upper}}</td>
* <td headers="matches">An upper-case alphabetic character:<tt>[A-Z]</tt></td></tr> * <td headers="matches">An upper-case alphabetic character:{@code [A-Z]}</td></tr>
* <tr><td valign="top" headers="construct posix"><tt>\p{ASCII}</tt></td> * <tr><td valign="top" headers="construct posix">{@code \p{ASCII}}</td>
* <td headers="matches">All ASCII:<tt>[\x00-\x7F]</tt></td></tr> * <td headers="matches">All ASCII:{@code [\x00-\x7F]}</td></tr>
* <tr><td valign="top" headers="construct posix"><tt>\p{Alpha}</tt></td> * <tr><td valign="top" headers="construct posix">{@code \p{Alpha}}</td>
* <td headers="matches">An alphabetic character:<tt>[\p{Lower}\p{Upper}]</tt></td></tr> * <td headers="matches">An alphabetic character:{@code [\p{Lower}\p{Upper}]}</td></tr>
* <tr><td valign="top" headers="construct posix"><tt>\p{Digit}</tt></td> * <tr><td valign="top" headers="construct posix">{@code \p{Digit}}</td>
* <td headers="matches">A decimal digit: <tt>[0-9]</tt></td></tr> * <td headers="matches">A decimal digit: {@code [0-9]}</td></tr>
* <tr><td valign="top" headers="construct posix"><tt>\p{Alnum}</tt></td> * <tr><td valign="top" headers="construct posix">{@code \p{Alnum}}</td>
* <td headers="matches">An alphanumeric character:<tt>[\p{Alpha}\p{Digit}]</tt></td></tr> * <td headers="matches">An alphanumeric character:{@code [\p{Alpha}\p{Digit}]}</td></tr>
* <tr><td valign="top" headers="construct posix"><tt>\p{Punct}</tt></td> * <tr><td valign="top" headers="construct posix">{@code \p{Punct}}</td>
* <td headers="matches">Punctuation: One of <tt>!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~</tt></td></tr> * <td headers="matches">Punctuation: One of {@code !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~}</td></tr>
* <!-- <tt>[\!"#\$%&'\(\)\*\+,\-\./:;\<=\>\?@\[\\\]\^_`\{\|\}~]</tt> * <!-- {@code [\!"#\$%&'\(\)\*\+,\-\./:;\<=\>\?@\[\\\]\^_`\{\|\}~]}
* <tt>[\X21-\X2F\X31-\X40\X5B-\X60\X7B-\X7E]</tt> --> * {@code [\X21-\X2F\X31-\X40\X5B-\X60\X7B-\X7E]} -->
* <tr><td valign="top" headers="construct posix"><tt>\p{Graph}</tt></td> * <tr><td valign="top" headers="construct posix">{@code \p{Graph}}</td>
* <td headers="matches">A visible character: <tt>[\p{Alnum}\p{Punct}]</tt></td></tr> * <td headers="matches">A visible character: {@code [\p{Alnum}\p{Punct}]}</td></tr>
* <tr><td valign="top" headers="construct posix"><tt>\p{Print}</tt></td> * <tr><td valign="top" headers="construct posix">{@code \p{Print}}</td>
* <td headers="matches">A printable character: <tt>[\p{Graph}\x20]</tt></td></tr> * <td headers="matches">A printable character: {@code [\p{Graph}\x20]}</td></tr>
* <tr><td valign="top" headers="construct posix"><tt>\p{Blank}</tt></td> * <tr><td valign="top" headers="construct posix">{@code \p{Blank}}</td>
* <td headers="matches">A space or a tab: <tt>[ \t]</tt></td></tr> * <td headers="matches">A space or a tab: {@code [ \t]}</td></tr>
* <tr><td valign="top" headers="construct posix"><tt>\p{Cntrl}</tt></td> * <tr><td valign="top" headers="construct posix">{@code \p{Cntrl}}</td>
* <td headers="matches">A control character: <tt>[\x00-\x1F\x7F]</tt></td></tr> * <td headers="matches">A control character: {@code [\x00-\x1F\x7F]}</td></tr>
* <tr><td valign="top" headers="construct posix"><tt>\p{XDigit}</tt></td> * <tr><td valign="top" headers="construct posix">{@code \p{XDigit}}</td>
* <td headers="matches">A hexadecimal digit: <tt>[0-9a-fA-F]</tt></td></tr> * <td headers="matches">A hexadecimal digit: {@code [0-9a-fA-F]}</td></tr>
* <tr><td valign="top" headers="construct posix"><tt>\p{Space}</tt></td> * <tr><td valign="top" headers="construct posix">{@code \p{Space}}</td>
* <td headers="matches">A whitespace character: <tt>[ \t\n\x0B\f\r]</tt></td></tr> * <td headers="matches">A whitespace character: {@code [ \t\n\x0B\f\r]}</td></tr>
* *
* <tr><th>&nbsp;</th></tr> * <tr><th>&nbsp;</th></tr>
* <tr align="left"><th colspan="2">java.lang.Character classes (simple <a href="#jcc">java character type</a>)</th></tr> * <tr align="left"><th colspan="2">java.lang.Character classes (simple <a href="#jcc">java character type</a>)</th></tr>
...@@ -220,19 +219,19 @@ import java.util.stream.StreamSupport; ...@@ -220,19 +219,19 @@ import java.util.stream.StreamSupport;
* *
* <tr><th>&nbsp;</th></tr> * <tr><th>&nbsp;</th></tr>
* <tr align="left"><th colspan="2" id="unicode">Classes for Unicode scripts, blocks, categories and binary properties</th></tr> * <tr align="left"><th colspan="2" id="unicode">Classes for Unicode scripts, blocks, categories and binary properties</th></tr>
* * <tr><td valign="top" headers="construct unicode"><tt>\p{IsLatin}</tt></td> * * <tr><td valign="top" headers="construct unicode">{@code \p{IsLatin}}</td>
* <td headers="matches">A Latin&nbsp;script character (<a href="#usc">script</a>)</td></tr> * <td headers="matches">A Latin&nbsp;script character (<a href="#usc">script</a>)</td></tr>
* <tr><td valign="top" headers="construct unicode"><tt>\p{InGreek}</tt></td> * <tr><td valign="top" headers="construct unicode">{@code \p{InGreek}}</td>
* <td headers="matches">A character in the Greek&nbsp;block (<a href="#ubc">block</a>)</td></tr> * <td headers="matches">A character in the Greek&nbsp;block (<a href="#ubc">block</a>)</td></tr>
* <tr><td valign="top" headers="construct unicode"><tt>\p{Lu}</tt></td> * <tr><td valign="top" headers="construct unicode">{@code \p{Lu}}</td>
* <td headers="matches">An uppercase letter (<a href="#ucc">category</a>)</td></tr> * <td headers="matches">An uppercase letter (<a href="#ucc">category</a>)</td></tr>
* <tr><td valign="top" headers="construct unicode"><tt>\p{IsAlphabetic}</tt></td> * <tr><td valign="top" headers="construct unicode">{@code \p{IsAlphabetic}}</td>
* <td headers="matches">An alphabetic character (<a href="#ubpc">binary property</a>)</td></tr> * <td headers="matches">An alphabetic character (<a href="#ubpc">binary property</a>)</td></tr>
* <tr><td valign="top" headers="construct unicode"><tt>\p{Sc}</tt></td> * <tr><td valign="top" headers="construct unicode">{@code \p{Sc}}</td>
* <td headers="matches">A currency symbol</td></tr> * <td headers="matches">A currency symbol</td></tr>
* <tr><td valign="top" headers="construct unicode"><tt>\P{InGreek}</tt></td> * <tr><td valign="top" headers="construct unicode">{@code \P{InGreek}}</td>
* <td headers="matches">Any character except one in the Greek block (negation)</td></tr> * <td headers="matches">Any character except one in the Greek block (negation)</td></tr>
* <tr><td valign="top" headers="construct unicode"><tt>[\p{L}&&[^\p{Lu}]]&nbsp;</tt></td> * <tr><td valign="top" headers="construct unicode">{@code [\p{L}&&[^\p{Lu}]]}</td>
* <td headers="matches">Any letter except an uppercase letter (subtraction)</td></tr> * <td headers="matches">Any letter except an uppercase letter (subtraction)</td></tr>
* *
* <tr><th>&nbsp;</th></tr> * <tr><th>&nbsp;</th></tr>
...@@ -376,8 +375,7 @@ import java.util.stream.StreamSupport; ...@@ -376,8 +375,7 @@ import java.util.stream.StreamSupport;
* <hr> * <hr>
* *
* *
* <a name="bs"> * <h3><a name="bs">Backslashes, escapes, and quoting</a></h3>
* <h4> Backslashes, escapes, and quoting </h4>
* *
* <p> The backslash character (<tt>'\'</tt>) serves to introduce escaped * <p> The backslash character (<tt>'\'</tt>) serves to introduce escaped
* constructs, as defined in the table above, as well as to quote characters * constructs, as defined in the table above, as well as to quote characters
...@@ -405,8 +403,7 @@ import java.util.stream.StreamSupport; ...@@ -405,8 +403,7 @@ import java.util.stream.StreamSupport;
* <tt>(hello)</tt> the string literal <tt>"&#92;&#92;(hello&#92;&#92;)"</tt> * <tt>(hello)</tt> the string literal <tt>"&#92;&#92;(hello&#92;&#92;)"</tt>
* must be used. * must be used.
* *
* <a name="cc"> * <h3><a name="cc">Character Classes</a></h3>
* <h4> Character Classes </h4>
* *
* <p> Character classes may appear within other character classes, and * <p> Character classes may appear within other character classes, and
* may be composed by the union operator (implicit) and the intersection * may be composed by the union operator (implicit) and the intersection
...@@ -435,7 +432,7 @@ import java.util.stream.StreamSupport; ...@@ -435,7 +432,7 @@ import java.util.stream.StreamSupport;
* <td><tt>[a-e][i-u]</tt></td></tr> * <td><tt>[a-e][i-u]</tt></td></tr>
* <tr><th>5&nbsp;&nbsp;&nbsp;&nbsp;</th> * <tr><th>5&nbsp;&nbsp;&nbsp;&nbsp;</th>
* <td>Intersection</td> * <td>Intersection</td>
* <td><tt>[a-z&&[aeiou]]</tt></td></tr> * <td>{@code [a-z&&[aeiou]]}</td></tr>
* </table></blockquote> * </table></blockquote>
* *
* <p> Note that a different set of metacharacters are in effect inside * <p> Note that a different set of metacharacters are in effect inside
...@@ -444,8 +441,7 @@ import java.util.stream.StreamSupport; ...@@ -444,8 +441,7 @@ import java.util.stream.StreamSupport;
* character class, while the expression <tt>-</tt> becomes a range * character class, while the expression <tt>-</tt> becomes a range
* forming metacharacter. * forming metacharacter.
* *
* <a name="lt"> * <h3><a name="lt">Line terminators</a></h3>
* <h4> Line terminators </h4>
* *
* <p> A <i>line terminator</i> is a one- or two-character sequence that marks * <p> A <i>line terminator</i> is a one- or two-character sequence that marks
* the end of a line of the input character sequence. The following are * the end of a line of the input character sequence. The following are
...@@ -480,11 +476,9 @@ import java.util.stream.StreamSupport; ...@@ -480,11 +476,9 @@ import java.util.stream.StreamSupport;
* except at the end of input. When in {@link #MULTILINE} mode <tt>$</tt> * except at the end of input. When in {@link #MULTILINE} mode <tt>$</tt>
* matches just before a line terminator or the end of the input sequence. * matches just before a line terminator or the end of the input sequence.
* *
* <a name="cg"> * <h3><a name="cg">Groups and capturing</a></h3>
* <h4> Groups and capturing </h4>
* *
* <a name="gnumber"> * <h4><a name="gnumber">Group number</a></h4>
* <h5> Group number </h5>
* <p> Capturing groups are numbered by counting their opening parentheses from * <p> Capturing groups are numbered by counting their opening parentheses from
* left to right. In the expression <tt>((A)(B(C)))</tt>, for example, there * left to right. In the expression <tt>((A)(B(C)))</tt>, for example, there
* are four such groups: </p> * are four such groups: </p>
...@@ -507,8 +501,7 @@ import java.util.stream.StreamSupport; ...@@ -507,8 +501,7 @@ import java.util.stream.StreamSupport;
* subsequence may be used later in the expression, via a back reference, and * subsequence may be used later in the expression, via a back reference, and
* may also be retrieved from the matcher once the match operation is complete. * may also be retrieved from the matcher once the match operation is complete.
* *
* <a name="groupname"> * <h4><a name="groupname">Group name</a></h4>
* <h5> Group name </h5>
* <p>A capturing group can also be assigned a "name", a <tt>named-capturing group</tt>, * <p>A capturing group can also be assigned a "name", a <tt>named-capturing group</tt>,
* and then be back-referenced later by the "name". Group names are composed of * and then be back-referenced later by the "name". Group names are composed of
* the following characters. The first character must be a <tt>letter</tt>. * the following characters. The first character must be a <tt>letter</tt>.
...@@ -537,7 +530,7 @@ import java.util.stream.StreamSupport; ...@@ -537,7 +530,7 @@ import java.util.stream.StreamSupport;
* that do not capture text and do not count towards the group total, or * that do not capture text and do not count towards the group total, or
* <i>named-capturing</i> group. * <i>named-capturing</i> group.
* *
* <h4> Unicode support </h4> * <h3> Unicode support </h3>
* *
* <p> This class is in conformance with Level 1 of <a * <p> This class is in conformance with Level 1 of <a
* href="http://www.unicode.org/reports/tr18/"><i>Unicode Technical * href="http://www.unicode.org/reports/tr18/"><i>Unicode Technical
...@@ -568,18 +561,18 @@ import java.util.stream.StreamSupport; ...@@ -568,18 +561,18 @@ import java.util.stream.StreamSupport;
* <p> * <p>
* Scripts, blocks, categories and binary properties can be used both inside * Scripts, blocks, categories and binary properties can be used both inside
* and outside of a character class. * and outside of a character class.
* <a name="usc"> *
* <p> * <p>
* <b>Scripts</b> are specified either with the prefix {@code Is}, as in * <b><a name="usc">Scripts</a></b> are specified either with the prefix {@code Is}, as in
* {@code IsHiragana}, or by using the {@code script} keyword (or its short * {@code IsHiragana}, or by using the {@code script} keyword (or its short
* form {@code sc})as in {@code script=Hiragana} or {@code sc=Hiragana}. * form {@code sc})as in {@code script=Hiragana} or {@code sc=Hiragana}.
* <p> * <p>
* The script names supported by <code>Pattern</code> are the valid script names * The script names supported by <code>Pattern</code> are the valid script names
* accepted and defined by * accepted and defined by
* {@link java.lang.Character.UnicodeScript#forName(String) UnicodeScript.forName}. * {@link java.lang.Character.UnicodeScript#forName(String) UnicodeScript.forName}.
* <a name="ubc"> *
* <p> * <p>
* <b>Blocks</b> are specified with the prefix {@code In}, as in * <b><a name="ubc">Blocks</a></b> are specified with the prefix {@code In}, as in
* {@code InMongolian}, or by using the keyword {@code block} (or its short * {@code InMongolian}, or by using the keyword {@code block} (or its short
* form {@code blk}) as in {@code block=Mongolian} or {@code blk=Mongolian}. * form {@code blk}) as in {@code block=Mongolian} or {@code blk=Mongolian}.
* <p> * <p>
...@@ -587,8 +580,8 @@ import java.util.stream.StreamSupport; ...@@ -587,8 +580,8 @@ import java.util.stream.StreamSupport;
* accepted and defined by * accepted and defined by
* {@link java.lang.Character.UnicodeBlock#forName(String) UnicodeBlock.forName}. * {@link java.lang.Character.UnicodeBlock#forName(String) UnicodeBlock.forName}.
* <p> * <p>
* <a name="ucc"> *
* <b>Categories</b> may be specified with the optional prefix {@code Is}: * <b><a name="ucc">Categories</a></b> may be specified with the optional prefix {@code Is}:
* Both {@code \p{L}} and {@code \p{IsL}} denote the category of Unicode * Both {@code \p{L}} and {@code \p{IsL}} denote the category of Unicode
* letters. Same as scripts and blocks, categories can also be specified * letters. Same as scripts and blocks, categories can also be specified
* by using the keyword {@code general_category} (or its short form * by using the keyword {@code general_category} (or its short form
...@@ -600,8 +593,8 @@ import java.util.stream.StreamSupport; ...@@ -600,8 +593,8 @@ import java.util.stream.StreamSupport;
* {@link java.lang.Character Character} class. The category names are those * {@link java.lang.Character Character} class. The category names are those
* defined in the Standard, both normative and informative. * defined in the Standard, both normative and informative.
* <p> * <p>
* <a name="ubpc"> *
* <b>Binary properties</b> are specified with the prefix {@code Is}, as in * <b><a name="ubpc">Binary properties</a></b> are specified with the prefix {@code Is}, as in
* {@code IsAlphabetic}. The supported binary properties by <code>Pattern</code> * {@code IsAlphabetic}. The supported binary properties by <code>Pattern</code>
* are * are
* <ul> * <ul>
...@@ -629,8 +622,8 @@ import java.util.stream.StreamSupport; ...@@ -629,8 +622,8 @@ import java.util.stream.StreamSupport;
* <table border="0" cellpadding="1" cellspacing="0" * <table border="0" cellpadding="1" cellspacing="0"
* summary="predefined and posix character classes in Unicode mode"> * summary="predefined and posix character classes in Unicode mode">
* <tr align="left"> * <tr align="left">
* <th bgcolor="#CCCCFF" align="left" id="classes">Classes</th> * <th align="left" id="predef_classes">Classes</th>
* <th bgcolor="#CCCCFF" align="left" id="matches">Matches</th> * <th align="left" id="predef_matches">Matches</th>
*</tr> *</tr>
* <tr><td><tt>\p{Lower}</tt></td> * <tr><td><tt>\p{Lower}</tt></td>
* <td>A lowercase character:<tt>\p{IsLowercase}</tt></td></tr> * <td>A lowercase character:<tt>\p{IsLowercase}</tt></td></tr>
...@@ -649,9 +642,9 @@ import java.util.stream.StreamSupport; ...@@ -649,9 +642,9 @@ import java.util.stream.StreamSupport;
* <tr><td><tt>\p{Graph}</tt></td> * <tr><td><tt>\p{Graph}</tt></td>
* <td>A visible character: <tt>[^\p{IsWhite_Space}\p{gc=Cc}\p{gc=Cs}\p{gc=Cn}]</tt></td></tr> * <td>A visible character: <tt>[^\p{IsWhite_Space}\p{gc=Cc}\p{gc=Cs}\p{gc=Cn}]</tt></td></tr>
* <tr><td><tt>\p{Print}</tt></td> * <tr><td><tt>\p{Print}</tt></td>
* <td>A printable character: <tt>[\p{Graph}\p{Blank}&&[^\p{Cntrl}]]</tt></td></tr> * <td>A printable character: {@code [\p{Graph}\p{Blank}&&[^\p{Cntrl}]]}</td></tr>
* <tr><td><tt>\p{Blank}</tt></td> * <tr><td><tt>\p{Blank}</tt></td>
* <td>A space or a tab: <tt>[\p{IsWhite_Space}&&[^\p{gc=Zl}\p{gc=Zp}\x0a\x0b\x0c\x0d\x85]]</tt></td></tr> * <td>A space or a tab: {@code [\p{IsWhite_Space}&&[^\p{gc=Zl}\p{gc=Zp}\x0a\x0b\x0c\x0d\x85]]}</td></tr>
* <tr><td><tt>\p{Cntrl}</tt></td> * <tr><td><tt>\p{Cntrl}</tt></td>
* <td>A control character: <tt>\p{gc=Cc}</tt></td></tr> * <td>A control character: <tt>\p{gc=Cc}</tt></td></tr>
* <tr><td><tt>\p{XDigit}</tt></td> * <tr><td><tt>\p{XDigit}</tt></td>
...@@ -676,9 +669,9 @@ import java.util.stream.StreamSupport; ...@@ -676,9 +669,9 @@ import java.util.stream.StreamSupport;
* Categories that behave like the java.lang.Character * Categories that behave like the java.lang.Character
* boolean is<i>methodname</i> methods (except for the deprecated ones) are * boolean is<i>methodname</i> methods (except for the deprecated ones) are
* available through the same <tt>\p{</tt><i>prop</i><tt>}</tt> syntax where * available through the same <tt>\p{</tt><i>prop</i><tt>}</tt> syntax where
* the specified property has the name <tt>java<i>methodname</i></tt>. * the specified property has the name <tt>java<i>methodname</i></tt></a>.
* *
* <h4> Comparison to Perl 5 </h4> * <h3> Comparison to Perl 5 </h3>
* *
* <p>The <code>Pattern</code> engine performs traditional NFA-based matching * <p>The <code>Pattern</code> engine performs traditional NFA-based matching
* with ordered alternation as occurs in Perl 5. * with ordered alternation as occurs in Perl 5.
...@@ -1023,11 +1016,11 @@ public final class Pattern ...@@ -1023,11 +1016,11 @@ public final class Pattern
private transient boolean hasSupplementary; private transient boolean hasSupplementary;
/** /**
* Compiles the given regular expression into a pattern. </p> * Compiles the given regular expression into a pattern.
* *
* @param regex * @param regex
* The expression to be compiled * The expression to be compiled
* * @return the given regular expression compiled into a pattern
* @throws PatternSyntaxException * @throws PatternSyntaxException
* If the expression's syntax is invalid * If the expression's syntax is invalid
*/ */
...@@ -1037,7 +1030,7 @@ public final class Pattern ...@@ -1037,7 +1030,7 @@ public final class Pattern
/** /**
* Compiles the given regular expression into a pattern with the given * Compiles the given regular expression into a pattern with the given
* flags. </p> * flags.
* *
* @param regex * @param regex
* The expression to be compiled * The expression to be compiled
...@@ -1049,6 +1042,7 @@ public final class Pattern ...@@ -1049,6 +1042,7 @@ public final class Pattern
* {@link #LITERAL}, {@link #UNICODE_CHARACTER_CLASS} * {@link #LITERAL}, {@link #UNICODE_CHARACTER_CLASS}
* and {@link #COMMENTS} * and {@link #COMMENTS}
* *
* @return the given regular expression compiled into a pattern with the given flags
* @throws IllegalArgumentException * @throws IllegalArgumentException
* If bit values other than those corresponding to the defined * If bit values other than those corresponding to the defined
* match flags are set in <tt>flags</tt> * match flags are set in <tt>flags</tt>
...@@ -1062,7 +1056,6 @@ public final class Pattern ...@@ -1062,7 +1056,6 @@ public final class Pattern
/** /**
* Returns the regular expression from which this pattern was compiled. * Returns the regular expression from which this pattern was compiled.
* </p>
* *
* @return The source of this pattern * @return The source of this pattern
*/ */
...@@ -1084,7 +1077,6 @@ public final class Pattern ...@@ -1084,7 +1077,6 @@ public final class Pattern
/** /**
* Creates a matcher that will match the given input against this pattern. * Creates a matcher that will match the given input against this pattern.
* </p>
* *
* @param input * @param input
* The character sequence to be matched * The character sequence to be matched
...@@ -1103,7 +1095,7 @@ public final class Pattern ...@@ -1103,7 +1095,7 @@ public final class Pattern
} }
/** /**
* Returns this pattern's match flags. </p> * Returns this pattern's match flags.
* *
* @return The match flags specified when this pattern was compiled * @return The match flags specified when this pattern was compiled
*/ */
...@@ -1133,7 +1125,7 @@ public final class Pattern ...@@ -1133,7 +1125,7 @@ public final class Pattern
* *
* @param input * @param input
* The character sequence to be matched * The character sequence to be matched
* * @return whether or not the regular expression matches on the input
* @throws PatternSyntaxException * @throws PatternSyntaxException
* If the expression's syntax is invalid * If the expression's syntax is invalid
*/ */
...@@ -1170,9 +1162,9 @@ public final class Pattern ...@@ -1170,9 +1162,9 @@ public final class Pattern
* *
* <blockquote><table cellpadding=1 cellspacing=0 * <blockquote><table cellpadding=1 cellspacing=0
* summary="Split examples showing regex, limit, and result"> * summary="Split examples showing regex, limit, and result">
* <tr><th><P align="left"><i>Regex&nbsp;&nbsp;&nbsp;&nbsp;</i></th> * <tr><th align="left"><i>Regex&nbsp;&nbsp;&nbsp;&nbsp;</i></th>
* <th><P align="left"><i>Limit&nbsp;&nbsp;&nbsp;&nbsp;</i></th> * <th align="left"><i>Limit&nbsp;&nbsp;&nbsp;&nbsp;</i></th>
* <th><P align="left"><i>Result&nbsp;&nbsp;&nbsp;&nbsp;</i></th></tr> * <th align="left"><i>Result&nbsp;&nbsp;&nbsp;&nbsp;</i></th></tr>
* <tr><td align=center>:</td> * <tr><td align=center>:</td>
* <td align=center>2</td> * <td align=center>2</td>
* <td><tt>{ "boo", "and:foo" }</tt></td></tr> * <td><tt>{ "boo", "and:foo" }</tt></td></tr>
...@@ -1253,8 +1245,8 @@ public final class Pattern ...@@ -1253,8 +1245,8 @@ public final class Pattern
* *
* <blockquote><table cellpadding=1 cellspacing=0 * <blockquote><table cellpadding=1 cellspacing=0
* summary="Split examples showing regex and result"> * summary="Split examples showing regex and result">
* <tr><th><P align="left"><i>Regex&nbsp;&nbsp;&nbsp;&nbsp;</i></th> * <tr><th align="left"><i>Regex&nbsp;&nbsp;&nbsp;&nbsp;</i></th>
* <th><P align="left"><i>Result</i></th></tr> * <th align="left"><i>Result</i></th></tr>
* <tr><td align=center>:</td> * <tr><td align=center>:</td>
* <td><tt>{ "boo", "and", "foo" }</tt></td></tr> * <td><tt>{ "boo", "and", "foo" }</tt></td></tr>
* <tr><td align=center>o</td> * <tr><td align=center>o</td>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册