< prev index next >

src/java.base/share/classes/java/util/regex/Pattern.java

Print this page

        

*** 77,93 **** * such use. * * * <h3><a id="sum">Summary of regular-expression constructs</a></h3> * ! * <table border="0" cellpadding="1" cellspacing="0" ! * summary="Regular expression constructs, and what they match"> ! * * <tr style="text-align:left"> * <th style="text-align:left" id="construct">Construct</th> * <th style="text-align:left" id="matches">Matches</th> * </tr> * * <tr><th>&nbsp;</th></tr> * <tr style="text-align:left"><th colspan="2" id="characters">Characters</th></tr> * * <tr><td style="vertical-align:top" headers="construct characters"><i>x</i></td> --- 77,95 ---- * such use. * * * <h3><a id="sum">Summary of regular-expression constructs</a></h3> * ! * <table class="borderless"> ! * <caption style="display:none">Regular expression constructs, and what they match</caption> ! * <thead> * <tr style="text-align:left"> * <th style="text-align:left" id="construct">Construct</th> * <th style="text-align:left" id="matches">Matches</th> * </tr> + * </thead> + * <tbody> * * <tr><th>&nbsp;</th></tr> * <tr style="text-align:left"><th colspan="2" id="characters">Characters</th></tr> * * <tr><td style="vertical-align:top" headers="construct characters"><i>x</i></td>
*** 381,390 **** --- 383,393 ---- * <tr><td style="vertical-align:top" headers="construct special">{@code (?<!}<i>X</i>{@code )}</td> * <td headers="matches"><i>X</i>, via zero-width negative lookbehind</td></tr> * <tr><td style="vertical-align:top" headers="construct special">{@code (?>}<i>X</i>{@code )}</td> * <td headers="matches"><i>X</i>, as an independent, non-capturing group</td></tr> * + * </tbody> * </table> * * <hr> * *
*** 427,438 **** * operand classes. * * <p> The precedence of character-class operators is as follows, from * highest to lowest: * ! * <blockquote><table border="0" cellpadding="1" cellspacing="0" ! * summary="Precedence of character class operators."> * <tr><th>1&nbsp;&nbsp;&nbsp;&nbsp;</th> * <td>Literal escape&nbsp;&nbsp;&nbsp;&nbsp;</td> * <td>{@code \x}</td></tr> * <tr><th>2&nbsp;&nbsp;&nbsp;&nbsp;</th> * <td>Grouping</td> --- 430,442 ---- * operand classes. * * <p> The precedence of character-class operators is as follows, from * highest to lowest: * ! * <blockquote><table> ! * <caption style="display:none">Precedence of character class operators.</caption> ! * <tbody> * <tr><th>1&nbsp;&nbsp;&nbsp;&nbsp;</th> * <td>Literal escape&nbsp;&nbsp;&nbsp;&nbsp;</td> * <td>{@code \x}</td></tr> * <tr><th>2&nbsp;&nbsp;&nbsp;&nbsp;</th> * <td>Grouping</td>
*** 444,453 **** --- 448,458 ---- * <td>Union</td> * <td>{@code [a-e][i-u]}</td></tr> * <tr><th>5&nbsp;&nbsp;&nbsp;&nbsp;</th> * <td>Intersection</td> * <td>{@code [a-z&&[aeiou]]}</td></tr> + * </tbody> * </table></blockquote> * * <p> Note that a different set of metacharacters are in effect inside * a character class than outside a character class. For instance, the * regular expression {@code .} loses its special meaning inside a
*** 494,512 **** * <h4><a id="gnumber">Group number</a></h4> * <p> Capturing groups are numbered by counting their opening parentheses from * left to right. In the expression {@code ((A)(B(C)))}, for example, there * are four such groups: </p> * ! * <blockquote><table cellpadding=1 cellspacing=0 summary="Capturing group numberings"> * <tr><th>1&nbsp;&nbsp;&nbsp;&nbsp;</th> * <td>{@code ((A)(B(C)))}</td></tr> * <tr><th>2&nbsp;&nbsp;&nbsp;&nbsp;</th> * <td>{@code (A)}</td></tr> * <tr><th>3&nbsp;&nbsp;&nbsp;&nbsp;</th> * <td>{@code (B(C))}</td></tr> * <tr><th>4&nbsp;&nbsp;&nbsp;&nbsp;</th> * <td>{@code (C)}</td></tr> * </table></blockquote> * * <p> Group zero always stands for the entire expression. * * <p> Capturing groups are so named because, during a match, each subsequence --- 499,520 ---- * <h4><a id="gnumber">Group number</a></h4> * <p> Capturing groups are numbered by counting their opening parentheses from * left to right. In the expression {@code ((A)(B(C)))}, for example, there * are four such groups: </p> * ! * <blockquote><table> ! * <caption style="display:none">Capturing group numberings</caption> ! * <tbody> * <tr><th>1&nbsp;&nbsp;&nbsp;&nbsp;</th> * <td>{@code ((A)(B(C)))}</td></tr> * <tr><th>2&nbsp;&nbsp;&nbsp;&nbsp;</th> * <td>{@code (A)}</td></tr> * <tr><th>3&nbsp;&nbsp;&nbsp;&nbsp;</th> * <td>{@code (B(C))}</td></tr> * <tr><th>4&nbsp;&nbsp;&nbsp;&nbsp;</th> * <td>{@code (C)}</td></tr> + * </tbody> * </table></blockquote> * * <p> Group zero always stands for the entire expression. * * <p> Capturing groups are so named because, during a match, each subsequence
*** 639,654 **** * The following <b>Predefined Character classes</b> and <b>POSIX character classes</b> * are in conformance with the recommendation of <i>Annex C: Compatibility Properties</i> * of <a href="http://www.unicode.org/reports/tr18/"><i>Unicode Regular Expression * </i></a>, when {@link #UNICODE_CHARACTER_CLASS} flag is specified. * ! * <table border="0" cellpadding="1" cellspacing="0" ! * summary="predefined and posix character classes in Unicode mode"> * <tr style="text-align:left"> * <th style="text-align:left" id="predef_classes">Classes</th> * <th style="text-align:left" id="predef_matches">Matches</th> ! *</tr> * <tr><td>{@code \p{Lower}}</td> * <td>A lowercase character:{@code \p{IsLowercase}}</td></tr> * <tr><td>{@code \p{Upper}}</td> * <td>An uppercase character:{@code \p{IsUppercase}}</td></tr> * <tr><td>{@code \p{ASCII}}</td> --- 647,665 ---- * The following <b>Predefined Character classes</b> and <b>POSIX character classes</b> * are in conformance with the recommendation of <i>Annex C: Compatibility Properties</i> * of <a href="http://www.unicode.org/reports/tr18/"><i>Unicode Regular Expression * </i></a>, when {@link #UNICODE_CHARACTER_CLASS} flag is specified. * ! * <table> ! * <caption style="display:none">predefined and posix character classes in Unicode mode</caption> ! * <thead> * <tr style="text-align:left"> * <th style="text-align:left" id="predef_classes">Classes</th> * <th style="text-align:left" id="predef_matches">Matches</th> ! * </tr> ! * </thead> ! * <tbody> * <tr><td>{@code \p{Lower}}</td> * <td>A lowercase character:{@code \p{IsLowercase}}</td></tr> * <tr><td>{@code \p{Upper}}</td> * <td>An uppercase character:{@code \p{IsUppercase}}</td></tr> * <tr><td>{@code \p{ASCII}}</td>
*** 683,692 **** --- 694,704 ---- * <td>A non-whitespace character: {@code [^\s]}</td></tr> * <tr><td>{@code \w}</td> * <td>A word character: {@code [\p{Alpha}\p{gc=Mn}\p{gc=Me}\p{gc=Mc}\p{Digit}\p{gc=Pc}\p{IsJoin_Control}]}</td></tr> * <tr><td>{@code \W}</td> * <td>A non-word character: {@code [^\w]}</td></tr> + * </tbody> * </table> * <p> * <a id="jcc"> * Categories that behave like the java.lang.Character * boolean is<i>methodname</i> methods (except for the deprecated ones) are
*** 1205,1219 **** * have any length, and trailing empty strings will be discarded. * * <p> The input {@code "boo:and:foo"}, for example, yields the following * results with these parameters: * ! * <blockquote><table cellpadding=1 cellspacing=0 ! * summary="Split examples showing regex, limit, and result"> * <tr><th style="text-align:left"><i>Regex&nbsp;&nbsp;&nbsp;&nbsp;</i></th> * <th style="text-align:left"><i>Limit&nbsp;&nbsp;&nbsp;&nbsp;</i></th> * <th style="text-align:left"><i>Result&nbsp;&nbsp;&nbsp;&nbsp;</i></th></tr> * <tr><td style="text-align:center">:</td> * <td style="text-align:center">2</td> * <td>{@code { "boo", "and:foo" }}</td></tr> * <tr><td style="text-align:center">:</td> * <td style="text-align:center">5</td> --- 1217,1234 ---- * have any length, and trailing empty strings will be discarded. * * <p> The input {@code "boo:and:foo"}, for example, yields the following * results with these parameters: * ! * <blockquote><table> ! * <caption>Split examples showing regex, limit, and result</caption> ! * <thead> * <tr><th style="text-align:left"><i>Regex&nbsp;&nbsp;&nbsp;&nbsp;</i></th> * <th style="text-align:left"><i>Limit&nbsp;&nbsp;&nbsp;&nbsp;</i></th> * <th style="text-align:left"><i>Result&nbsp;&nbsp;&nbsp;&nbsp;</i></th></tr> + * </thead> + * <tbody> * <tr><td style="text-align:center">:</td> * <td style="text-align:center">2</td> * <td>{@code { "boo", "and:foo" }}</td></tr> * <tr><td style="text-align:center">:</td> * <td style="text-align:center">5</td>
*** 1228,1237 **** --- 1243,1253 ---- * <td style="text-align:center">-2</td> * <td>{@code { "b", "", ":and:f", "", "" }}</td></tr> * <tr><td style="text-align:center">o</td> * <td style="text-align:center">0</td> * <td>{@code { "b", "", ":and:f" }}</td></tr> + * </tbody> * </table></blockquote> * * @param input * The character sequence to be split *
*** 1292,1309 **** * therefore not included in the resulting array. </p> * * <p> The input {@code "boo:and:foo"}, for example, yields the following * results with these expressions: * ! * <blockquote><table cellpadding=1 cellspacing=0 ! * summary="Split examples showing regex and result"> * <tr><th style="text-align:left"><i>Regex&nbsp;&nbsp;&nbsp;&nbsp;</i></th> * <th style="text-align:left"><i>Result</i></th></tr> * <tr><td style="text-align:center">:</td> * <td>{@code { "boo", "and", "foo" }}</td></tr> * <tr><td style="text-align:center">o</td> * <td>{@code { "b", "", ":and:f" }}</td></tr> * </table></blockquote> * * * @param input * The character sequence to be split --- 1308,1329 ---- * therefore not included in the resulting array. </p> * * <p> The input {@code "boo:and:foo"}, for example, yields the following * results with these expressions: * ! * <blockquote><table> ! * <caption style="display:none">Split examples showing regex and result</caption> ! * <thead> * <tr><th style="text-align:left"><i>Regex&nbsp;&nbsp;&nbsp;&nbsp;</i></th> * <th style="text-align:left"><i>Result</i></th></tr> + * </thead> + * <tbody> * <tr><td style="text-align:center">:</td> * <td>{@code { "boo", "and", "foo" }}</td></tr> * <tr><td style="text-align:center">o</td> * <td>{@code { "b", "", ":and:f" }}</td></tr> + * </tbody> * </table></blockquote> * * * @param input * The character sequence to be split
< prev index next >