Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
335f51e9
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
335f51e9
编写于
7月 08, 2013
作者:
D
darcy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8020095: Fix doclint warnings in java.util.regex
Reviewed-by: mchung
上级
4d81c909
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
102 addition
and
109 deletion
+102
-109
src/share/classes/java/util/regex/MatchResult.java
src/share/classes/java/util/regex/MatchResult.java
+2
-2
src/share/classes/java/util/regex/Matcher.java
src/share/classes/java/util/regex/Matcher.java
+8
-7
src/share/classes/java/util/regex/Pattern.java
src/share/classes/java/util/regex/Pattern.java
+92
-100
未找到文件。
src/share/classes/java/util/regex/MatchResult.java
浏览文件 @
335f51e9
/*
* Copyright (c) 2003, 20
04
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
13
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -77,7 +77,7 @@ public interface MatchResult {
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
*
...
...
src/share/classes/java/util/regex/Matcher.java
浏览文件 @
335f51e9
/*
* Copyright (c) 1999, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 201
3
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -28,8 +28,8 @@ package java.util.regex;
import
java.util.Objects
;
/**
* An engine that performs match operations on a {@link java.lang.CharSequence
*
</code>character sequence<code>
} by interpreting a {@link Pattern}.
* An engine that performs match operations on a {@link
plain
java.lang.CharSequence
*
character sequence
} by interpreting a {@link Pattern}.
*
* <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
...
...
@@ -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
*
...
...
@@ -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
*
...
...
@@ -647,6 +647,7 @@ public final class Matcher implements MatchResult {
* invocations of the {@link #find()} method will start at the first
* character not matched by this match. </p>
*
* @param start the index to start searching for a match
* @throws IndexOutOfBoundsException
* If start is less than zero or if start is greater than the
* length of the input sequence.
...
...
@@ -736,8 +737,8 @@ public final class Matcher implements MatchResult {
* captured during the previous match: Each occurrence of
* <tt>${</tt><i>name</i><tt>}</tt> or <tt>$</tt><i>g</i>
* will be replaced by the result of evaluating the corresponding
* {@link #group(String) group(name)} or {@link #group(int) group(g)
</tt>
}
* respectively. For <tt>$</tt><i>g</i>
<tt></tt>
,
* {@link #group(String) group(name)} or {@link #group(int) group(g)}
* respectively. For <tt>$</tt><i>g</i>,
* the first number after the <tt>$</tt> is always treated as part of
* the group reference. Subsequent numbers are incorporated into g if
* they would form a legal group reference. Only the numerals '0'
...
...
src/share/classes/java/util/regex/Pattern.java
浏览文件 @
335f51e9
...
...
@@ -45,8 +45,8 @@ import java.util.stream.StreamSupport;
*
* <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
* a {@link Matcher} object that can match arbitrary {@link
* java.lang.CharSequence
</code>character sequences<code>
} against the regular
* a {@link Matcher} object that can match arbitrary {@link
plain
* java.lang.CharSequence
character sequences
} against the regular
* expression. All of the state involved in performing a match resides in the
* matcher, so many matchers can share the same pattern.
*
...
...
@@ -73,15 +73,14 @@ import java.util.stream.StreamSupport;
* such use.
*
*
* <a name="sum">
* <h4> Summary of regular-expression constructs </h4>
* <h3><a name="sum">Summary of regular-expression constructs</a></h3>
*
* <table border="0" cellpadding="1" cellspacing="0"
* summary="Regular expression constructs, and what they match">
*
* <tr align="left">
* <th
bgcolor="#CCCCFF"
align="left" id="construct">Construct</th>
* <th
bgcolor="#CCCCFF"
align="left" id="matches">Matches</th>
* <th align="left" id="construct">Construct</th>
* <th align="left" id="matches">Matches</th>
* </tr>
*
* <tr><th> </th></tr>
...
...
@@ -128,24 +127,24 @@ import java.util.stream.StreamSupport;
* <tr><th> </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>
* <td headers="matches">
<tt>a</tt>, <tt>b</tt>, or <tt>c</tt>
(simple class)</td></tr>
* <tr><td valign="top" headers="construct classes">
<tt>[^abc]</tt>
</td>
* <td headers="matches">Any character except
<tt>a</tt>, <tt>b</tt>, or <tt>c</tt>
(negation)</td></tr>
* <tr><td valign="top" headers="construct classes">
<tt>[a-zA-Z]</tt>
</td>
* <td headers="matches">
<tt>a</tt> through <tt>z</tt>
* or
<tt>A</tt> through <tt>Z</tt>
, inclusive (range)</td></tr>
* <tr><td valign="top" headers="construct classes">
<tt>[a-d[m-p]]</tt>
</td>
* <td headers="matches">
<tt>a</tt> through <tt>d</tt>
,
* or
<tt>m</tt> through <tt>p</tt>: <tt>[a-dm-p]</tt>
(union)</td></tr>
* <tr><td valign="top" headers="construct classes">
<tt>[a-z&&[def]]</tt>
</td>
* <td headers="matches">
<tt>d</tt>, <tt>e</tt>, or <tt>f</tt>
(intersection)</tr>
* <tr><td valign="top" headers="construct classes">
<tt>[a-z&&[^bc]]</tt>
</td>
* <td headers="matches">
<tt>a</tt> through <tt>z</tt>
,
* except for
<tt>b</tt> and <tt>c</tt>: <tt>[ad-z]</tt>
(subtraction)</td></tr>
* <tr><td valign="top" headers="construct classes">
<tt>[a-z&&[^m-p]]</tt>
</td>
* <td headers="matches">
<tt>a</tt> through <tt>z</tt>
,
* and not
<tt>m</tt> through <tt>p</tt>: <tt>[a-lq-z]</tt>
(subtraction)</td></tr>
* <tr><td valign="top" headers="construct classes">
{@code [abc]}
</td>
* <td headers="matches">
{@code a}, {@code b}, or {@code c}
(simple class)</td></tr>
* <tr><td valign="top" headers="construct classes">
{@code [^abc]}
</td>
* <td headers="matches">Any character except
{@code a}, {@code b}, or {@code c}
(negation)</td></tr>
* <tr><td valign="top" headers="construct classes">
{@code [a-zA-Z]}
</td>
* <td headers="matches">
{@code a} through {@code z}
* or
{@code A} through {@code Z}
, inclusive (range)</td></tr>
* <tr><td valign="top" headers="construct classes">
{@code [a-d[m-p]]}
</td>
* <td headers="matches">
{@code a} through {@code d}
,
* or
{@code m} through {@code p}: {@code [a-dm-p]}
(union)</td></tr>
* <tr><td valign="top" headers="construct classes">
{@code [a-z&&[def]]}
</td>
* <td headers="matches">
{@code d}, {@code e}, or {@code f}
(intersection)</tr>
* <tr><td valign="top" headers="construct classes">
{@code [a-z&&[^bc]]}
</td>
* <td headers="matches">
{@code a} through {@code z}
,
* except for
{@code b} and {@code c}: {@code [ad-z]}
(subtraction)</td></tr>
* <tr><td valign="top" headers="construct classes">
{@code [a-z&&[^m-p]]}
</td>
* <td headers="matches">
{@code a} through {@code z}
,
* and not
{@code m} through {@code p}: {@code [a-lq-z]}
(subtraction)</td></tr>
* <tr><th> </th></tr>
*
* <tr align="left"><th colspan="2" id="predef">Predefined character classes</th></tr>
...
...
@@ -175,36 +174,36 @@ import java.util.stream.StreamSupport;
* <tr><td valign="top" headers="construct predef"><tt>\W</tt></td>
* <td headers="matches">A non-word character: <tt>[^\w]</tt></td></tr>
* <tr><th> </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>
* <td headers="matches">A lower-case alphabetic character:
<tt>[a-z]</tt>
</td></tr>
* <tr><td valign="top" headers="construct posix">
<tt>\p{Upper}</tt>
</td>
* <td headers="matches">An upper-case alphabetic character:
<tt>[A-Z]</tt>
</td></tr>
* <tr><td valign="top" headers="construct posix">
<tt>\p{ASCII}</tt>
</td>
* <td headers="matches">All ASCII:
<tt>[\x00-\x7F]</tt>
</td></tr>
* <tr><td valign="top" headers="construct posix">
<tt>\p{Alpha}</tt>
</td>
* <td headers="matches">An alphabetic character:
<tt>[\p{Lower}\p{Upper}]</tt>
</td></tr>
* <tr><td valign="top" headers="construct posix">
<tt>\p{Digit}</tt>
</td>
* <td headers="matches">A decimal digit:
<tt>[0-9]</tt>
</td></tr>
* <tr><td valign="top" headers="construct posix">
<tt>\p{Alnum}</tt>
</td>
* <td headers="matches">An alphanumeric character:
<tt>[\p{Alpha}\p{Digit}]</tt>
</td></tr>
* <tr><td valign="top" headers="construct posix">
<tt>\p{Punct}</tt>
</td>
* <td headers="matches">Punctuation: One of
<tt>!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~</tt>
</td></tr>
* <!--
<tt>[\!"#\$%&'\(\)\*\+,\-\./:;\<=\>\?@\[\\\]\^_`\{\|\}~]</tt>
*
<tt>[\X21-\X2F\X31-\X40\X5B-\X60\X7B-\X7E]</tt>
-->
* <tr><td valign="top" headers="construct posix">
<tt>\p{Graph}</tt>
</td>
* <td headers="matches">A visible character:
<tt>[\p{Alnum}\p{Punct}]</tt>
</td></tr>
* <tr><td valign="top" headers="construct posix">
<tt>\p{Print}</tt>
</td>
* <td headers="matches">A printable character:
<tt>[\p{Graph}\x20]</tt>
</td></tr>
* <tr><td valign="top" headers="construct posix">
<tt>\p{Blank}</tt>
</td>
* <td headers="matches">A space or a tab:
<tt>[ \t]</tt>
</td></tr>
* <tr><td valign="top" headers="construct posix">
<tt>\p{Cntrl}</tt>
</td>
* <td headers="matches">A control character:
<tt>[\x00-\x1F\x7F]</tt>
</td></tr>
* <tr><td valign="top" headers="construct posix">
<tt>\p{XDigit}</tt>
</td>
* <td headers="matches">A hexadecimal digit:
<tt>[0-9a-fA-F]</tt>
</td></tr>
* <tr><td valign="top" headers="construct posix">
<tt>\p{Space}</tt>
</td>
* <td headers="matches">A whitespace character:
<tt>[ \t\n\x0B\f\r]</tt>
</td></tr>
* <tr><td valign="top" headers="construct posix">
{@code \p{Lower}}
</td>
* <td headers="matches">A lower-case alphabetic character:
{@code [a-z]}
</td></tr>
* <tr><td valign="top" headers="construct posix">
{@code \p{Upper}}
</td>
* <td headers="matches">An upper-case alphabetic character:
{@code [A-Z]}
</td></tr>
* <tr><td valign="top" headers="construct posix">
{@code \p{ASCII}}
</td>
* <td headers="matches">All ASCII:
{@code [\x00-\x7F]}
</td></tr>
* <tr><td valign="top" headers="construct posix">
{@code \p{Alpha}}
</td>
* <td headers="matches">An alphabetic character:
{@code [\p{Lower}\p{Upper}]}
</td></tr>
* <tr><td valign="top" headers="construct posix">
{@code \p{Digit}}
</td>
* <td headers="matches">A decimal digit:
{@code [0-9]}
</td></tr>
* <tr><td valign="top" headers="construct posix">
{@code \p{Alnum}}
</td>
* <td headers="matches">An alphanumeric character:
{@code [\p{Alpha}\p{Digit}]}
</td></tr>
* <tr><td valign="top" headers="construct posix">
{@code \p{Punct}}
</td>
* <td headers="matches">Punctuation: One of
{@code !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~}
</td></tr>
* <!--
{@code [\!"#\$%&'\(\)\*\+,\-\./:;\<=\>\?@\[\\\]\^_`\{\|\}~]}
*
{@code [\X21-\X2F\X31-\X40\X5B-\X60\X7B-\X7E]}
-->
* <tr><td valign="top" headers="construct posix">
{@code \p{Graph}}
</td>
* <td headers="matches">A visible character:
{@code [\p{Alnum}\p{Punct}]}
</td></tr>
* <tr><td valign="top" headers="construct posix">
{@code \p{Print}}
</td>
* <td headers="matches">A printable character:
{@code [\p{Graph}\x20]}
</td></tr>
* <tr><td valign="top" headers="construct posix">
{@code \p{Blank}}
</td>
* <td headers="matches">A space or a tab:
{@code [ \t]}
</td></tr>
* <tr><td valign="top" headers="construct posix">
{@code \p{Cntrl}}
</td>
* <td headers="matches">A control character:
{@code [\x00-\x1F\x7F]}
</td></tr>
* <tr><td valign="top" headers="construct posix">
{@code \p{XDigit}}
</td>
* <td headers="matches">A hexadecimal digit:
{@code [0-9a-fA-F]}
</td></tr>
* <tr><td valign="top" headers="construct posix">
{@code \p{Space}}
</td>
* <td headers="matches">A whitespace character:
{@code [ \t\n\x0B\f\r]}
</td></tr>
*
* <tr><th> </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;
*
* <tr><th> </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 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 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>
* <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>
* <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>
* <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>
* <tr><td valign="top" headers="construct unicode">
<tt>[\p{L}&&[^\p{Lu}]] </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>
*
* <tr><th> </th></tr>
...
...
@@ -376,8 +375,7 @@ import java.util.stream.StreamSupport;
* <hr>
*
*
* <a name="bs">
* <h4> Backslashes, escapes, and quoting </h4>
* <h3><a name="bs">Backslashes, escapes, and quoting</a></h3>
*
* <p> The backslash character (<tt>'\'</tt>) serves to introduce escaped
* constructs, as defined in the table above, as well as to quote characters
...
...
@@ -405,8 +403,7 @@ import java.util.stream.StreamSupport;
* <tt>(hello)</tt> the string literal <tt>"\\(hello\\)"</tt>
* must be used.
*
* <a name="cc">
* <h4> Character Classes </h4>
* <h3><a name="cc">Character Classes</a></h3>
*
* <p> Character classes may appear within other character classes, and
* may be composed by the union operator (implicit) and the intersection
...
...
@@ -435,7 +432,7 @@ import java.util.stream.StreamSupport;
* <td><tt>[a-e][i-u]</tt></td></tr>
* <tr><th>5 </th>
* <td>Intersection</td>
* <td>
<tt>[a-z&&[aeiou]]</tt>
</td></tr>
* <td>
{@code [a-z&&[aeiou]]}
</td></tr>
* </table></blockquote>
*
* <p> Note that a different set of metacharacters are in effect inside
...
...
@@ -444,8 +441,7 @@ import java.util.stream.StreamSupport;
* character class, while the expression <tt>-</tt> becomes a range
* forming metacharacter.
*
* <a name="lt">
* <h4> Line terminators </h4>
* <h3><a name="lt">Line terminators</a></h3>
*
* <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
...
...
@@ -480,11 +476,9 @@ import java.util.stream.StreamSupport;
* 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.
*
* <a name="cg">
* <h4> Groups and capturing </h4>
* <h3><a name="cg">Groups and capturing</a></h3>
*
* <a name="gnumber">
* <h5> Group number </h5>
* <h4><a name="gnumber">Group number</a></h4>
* <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
* are four such groups: </p>
...
...
@@ -507,8 +501,7 @@ import java.util.stream.StreamSupport;
* 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.
*
* <a name="groupname">
* <h5> Group name </h5>
* <h4><a name="groupname">Group name</a></h4>
* <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
* the following characters. The first character must be a <tt>letter</tt>.
...
...
@@ -537,7 +530,7 @@ import java.util.stream.StreamSupport;
* that do not capture text and do not count towards the group total, or
* <i>named-capturing</i> group.
*
* <h
4> Unicode support </h4
>
* <h
3> Unicode support </h3
>
*
* <p> This class is in conformance with Level 1 of <a
* href="http://www.unicode.org/reports/tr18/"><i>Unicode Technical
...
...
@@ -568,18 +561,18 @@ import java.util.stream.StreamSupport;
* <p>
* Scripts, blocks, categories and binary properties can be used both inside
* and outside of a character class.
*
<a name="usc">
*
* <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
* form {@code sc})as in {@code script=Hiragana} or {@code sc=Hiragana}.
* <p>
* The script names supported by <code>Pattern</code> are the valid script names
* accepted and defined by
* {@link java.lang.Character.UnicodeScript#forName(String) UnicodeScript.forName}.
*
<a name="ubc">
*
* <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
* form {@code blk}) as in {@code block=Mongolian} or {@code blk=Mongolian}.
* <p>
...
...
@@ -587,8 +580,8 @@ import java.util.stream.StreamSupport;
* accepted and defined by
* {@link java.lang.Character.UnicodeBlock#forName(String) UnicodeBlock.forName}.
* <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
* letters. Same as scripts and blocks, categories can also be specified
* by using the keyword {@code general_category} (or its short form
...
...
@@ -600,8 +593,8 @@ import java.util.stream.StreamSupport;
* {@link java.lang.Character Character} class. The category names are those
* defined in the Standard, both normative and informative.
* <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>
* are
* <ul>
...
...
@@ -629,8 +622,8 @@ import java.util.stream.StreamSupport;
* <table border="0" cellpadding="1" cellspacing="0"
* summary="predefined and posix character classes in Unicode mode">
* <tr align="left">
* <th
bgcolor="#CCCCFF" align="left" id="
classes">Classes</th>
* <th
bgcolor="#CCCCFF" align="left" id="
matches">Matches</th>
* <th
align="left" id="predef_
classes">Classes</th>
* <th
align="left" id="predef_
matches">Matches</th>
*</tr>
* <tr><td><tt>\p{Lower}</tt></td>
* <td>A lowercase character:<tt>\p{IsLowercase}</tt></td></tr>
...
...
@@ -649,9 +642,9 @@ import java.util.stream.StreamSupport;
* <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>
* <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>
* <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>
* <td>A control character: <tt>\p{gc=Cc}</tt></td></tr>
* <tr><td><tt>\p{XDigit}</tt></td>
...
...
@@ -676,9 +669,9 @@ import java.util.stream.StreamSupport;
* Categories that behave like the java.lang.Character
* 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
* 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>
.
*
* <h
4> Comparison to Perl 5 </h4
>
* <h
3> Comparison to Perl 5 </h3
>
*
* <p>The <code>Pattern</code> engine performs traditional NFA-based matching
* with ordered alternation as occurs in Perl 5.
...
...
@@ -1023,11 +1016,11 @@ public final class Pattern
private
transient
boolean
hasSupplementary
;
/**
* Compiles the given regular expression into a pattern.
</p>
* Compiles the given regular expression into a pattern.
*
* @param regex
* The expression to be compiled
*
*
@return the given regular expression compiled into a pattern
* @throws PatternSyntaxException
* If the expression's syntax is invalid
*/
...
...
@@ -1037,7 +1030,7 @@ public final class Pattern
/**
* Compiles the given regular expression into a pattern with the given
* flags.
</p>
* flags.
*
* @param regex
* The expression to be compiled
...
...
@@ -1049,6 +1042,7 @@ public final class Pattern
* {@link #LITERAL}, {@link #UNICODE_CHARACTER_CLASS}
* and {@link #COMMENTS}
*
* @return the given regular expression compiled into a pattern with the given flags
* @throws IllegalArgumentException
* If bit values other than those corresponding to the defined
* match flags are set in <tt>flags</tt>
...
...
@@ -1062,7 +1056,6 @@ public final class Pattern
/**
* Returns the regular expression from which this pattern was compiled.
* </p>
*
* @return The source of this pattern
*/
...
...
@@ -1084,7 +1077,6 @@ public final class Pattern
/**
* Creates a matcher that will match the given input against this pattern.
* </p>
*
* @param input
* The character sequence to be matched
...
...
@@ -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
*/
...
...
@@ -1133,7 +1125,7 @@ public final class Pattern
*
* @param input
* The character sequence to be matched
*
*
@return whether or not the regular expression matches on the input
* @throws PatternSyntaxException
* If the expression's syntax is invalid
*/
...
...
@@ -1170,9 +1162,9 @@ public final class Pattern
*
* <blockquote><table cellpadding=1 cellspacing=0
* summary="Split examples showing regex, limit, and result">
* <tr><th
><P
align="left"><i>Regex </i></th>
* <th
><P
align="left"><i>Limit </i></th>
* <th
><P
align="left"><i>Result </i></th></tr>
* <tr><th align="left"><i>Regex </i></th>
* <th align="left"><i>Limit </i></th>
* <th align="left"><i>Result </i></th></tr>
* <tr><td align=center>:</td>
* <td align=center>2</td>
* <td><tt>{ "boo", "and:foo" }</tt></td></tr>
...
...
@@ -1253,8 +1245,8 @@ public final class Pattern
*
* <blockquote><table cellpadding=1 cellspacing=0
* summary="Split examples showing regex and result">
* <tr><th
><P
align="left"><i>Regex </i></th>
* <th
><P
align="left"><i>Result</i></th></tr>
* <tr><th align="left"><i>Regex </i></th>
* <th align="left"><i>Result</i></th></tr>
* <tr><td align=center>:</td>
* <td><tt>{ "boo", "and", "foo" }</tt></td></tr>
* <tr><td align=center>o</td>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录