Pattern クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
正規表現のコンパイル済み表現。
[Android.Runtime.Register("java/util/regex/Pattern", DoNotGenerateAcw=true)]
public sealed class Pattern : Java.Lang.Object, IDisposable, Java.Interop.IJavaPeerable, Java.IO.ISerializable
[<Android.Runtime.Register("java/util/regex/Pattern", DoNotGenerateAcw=true)>]
type Pattern = class
inherit Object
interface ISerializable
interface IJavaObject
interface IDisposable
interface IJavaPeerable
- 継承
- 属性
- 実装
注釈
正規表現のコンパイル済み表現。
文字列として指定された正規表現は、最初にこのクラスのインスタンスにコンパイルする必要があります。 その後、結果のパターンを使用して、任意の java.lang.CharSequence 文字シーケンスと正規表現を照合できるオブジェクトを作成 Matcher
できます。 一致の実行に関係するすべての状態はマッチャーに存在するため、多くのマッチャーで同じパターンを共有できます。
したがって、一般的な呼び出しシーケンスは次の手順で実行されます。
<blockquote>
Pattern p = Pattern.{@link #compile compile}("a*b");
Matcher m = p.{@link #matcher matcher}("aaaaab");
boolean b = m.{@link Matcher#matches matches}();
</blockquote>
#matches matches
メソッドは、正規表現が 1 回だけ使用される場合の便利な方法として、このクラスによって定義されます。 このメソッドは、式をコンパイルし、1 回の呼び出しで入力シーケンスを照合します。 次のステートメント、
<blockquote>
boolean b = Pattern.matches("a*b", "aaaaab");
</blockquote>
は上記の 3 つのステートメントと同じですが、繰り返し一致する場合は、コンパイルされたパターンを再利用できないため、効率が低くなります。
このクラスのインスタンスは不変であり、複数の同時実行スレッドで使用しても安全です。 クラスの Matcher
インスタンスは、このような使用には安全ではありません。
<h2>"sum">正規表現コンストラクト/h2 の<概要>
<table class="borderless"><キャプション style="display:none">Regular expression constructs, and what they match</キャプション<>thead style="text-align:text-align:left"><tr<>th id="construct></th th<>id="matches">Matches</th></tr></thead><tbody style="text-align:left">
<tr><th colspan="2" style="padding-top:20px" id="characters">Characters</th></tr>
<tr><th style="vertical-align:top; font-weight: normal" id="x">x</th><td headers="matches character x">The character x</td></tr tr><><th style="vertical-align:top; font-weight: normal" id="backslash"><\\
/th<>td headers="matches characters backslash">The backslash character</td></tr tr><th><style="vertical-align:top; font-weight: normal" id="octal_n">\0
n</th><td headers="はoctal_n文字と一致します">8 進数の値0
を持つ文字 n (0 <=
n <=
7)</td></tr tr><><th style="vertical-align:top; font-weight: normal" id="octal_nn"\0
>nn</th<>td headers="matches characters octal_nn">The character with octal value 0
nn (0 <=
n <=
7)</td></tr tr><th><style="vertical-align:top; font-weight: normal" id="octal_nnn"\0
>mnn</th><td headers="matches characters octal_nnn">The character with octal value 0
mnn (0 <=
m <=
nbsp&;3, 0 <=
nbsp&;n <=
7)</td></tr tr><><th style="vertical-align:top; font-weight: normal" id="hex_hh"\x
>hh</th<>td headers="matches characters hex_hh">The character with hexadecimal value 0x
hh</td></tr tr><th><style="vertical-align:top; font-weight: normal" id="hex_hhhh">\u
hhhh</th><td headers="matches characters hex_hhhh">nbsp&16 進数の文字。値 0x
hhhh</td></tr tr><th><style="vertical-align:top; font-weight: normal" id="hex_h_h">\x
{h..h}</th><td headers="は、hex_h_h文字と一致します">16 進数の値 0x
h... を持つ文字。h (java.lang.Character#MIN_CODE_POINT Character.MIN_CODE_POINT
<= 0x
H。。。h <= java.lang.Character#MAX_CODE_POINT Character.MAX_CODE_POINT
)</td></tr tr><><th style="vertical-align:top; font-weight: normal" id="unicode_name"\N{
>name}
</th><td headers="matches characters unicode_name">The character with Unicode character name 'name'</td></tr tr th><><style="vertical-align:top; font-weight:normal" id="tab"<\t
>/th><td headers="matches characters tab"The tab">The tabcharacter ('\u0009'
)</td></tr tr><><th style="vertical-align:top; font-weight:normal" id="newline">\n
</th><td headers="matches characters newline">The newline (line feed) character ('\u000A'
)</td></tr tr<>th><style="vertical-align:top; font-weight:normal" id="return"><\r
/th><td headers="matches characters return">The carriage-return character ( ('\u000D'
)</td></tr><th><style="vertical-align:top; font-weight:normal" id="form_feed">\f
</th<>td headers="matches characters form_feed">The form-feed character ('\u000C'
)</td></tr tr<>th><style="vertical-align:top; font-weight:normal" id="bell"<>\a
/th<>td headers="matches characters bell">The alert (bell) character ('\u0007'
)</td></tr tr><tr><th style="vertical-align:top; font-weight:normal" id="escape">\e
</th><td headers="matches characters escape"The escape">The escape character ('\u001B'
)</td></tr tr<>th><style="vertical-align:top; font-weight:normal" id="ctrl_x">\c
x</th><td headers="matches characters ctrl_x">The control character corresponding to x</td></tr tr>
<tr><th colspan="2" style="padding-top:20px" id="classes">Character classes</th></tr>
<tr><th style="vertical-align:top; font-weight:normal" id="simple"><[abc]
/th><td headers="matches classes simple">a
, b
or c
(simple class)</td></tr tr>><<th style="vertical-align:top; font-weight:normal" id="negation">[^abc]
</th<>td headers="matches classes negation">Any character except a
, b
, , or c
(negation)</td></tr tr tr><><th style="vertical-align:top;font-weight:normal" id="range"><[a-zA-Z]
/th><td headers="matches classes range">a
through z
or A
through Z
, inclusive (range)</td></tr tr><><th style="vertical-align:top; font-weight:normal" id="union">[a-d[m-p]]
</th><td headers="matches classes union">a
through d
, or m
through p
: [a-dm-p]
(union)</td></tr tr><><th style="vertical-align:top;font-weight:normal" id="intersection"><[a-z&&[def]]
/th><td headers="matches classes intersection">d
, , e
or f
(intersection)</tr tr><<>th style="vertical-align:top; font-weight:normal" id="subtraction1">[a-z&&[^bc]]
</th><td headers="matches classes subtraction1">a
through z
, except for b
and c
: [ad-z]
(subtraction)</td></tr tr><><th style="vertical-align:top;font-weight:normal" id="subtraction2"><[a-z&&[^m-p]]
/th><td headers="matches classes subtraction2">a
to z
, and not m
through p
: [a-lq-z]
(subtraction)</td></tr>
<tr><th colspan="2" style="padding-top:20px" id="predef">Predefined character classes</th></tr>
<tr><th style="vertical-align:top; font-weight:normal" id="any">.
</th><td headers="matchs predef any">Any character (may or not match line terminators)</td></tr tr><><th style="vertical-align:top; font-weight:normal" id="digit">\d
</th<>td headers="matches predef digit">A digit: \p{IsDigit
}</td></tr tr><><th style="vertical-align:top; font-weight:normal" id="non_digit">\D
</th><td headers="matches predef non_digit">A non-digit: [^\d]
</td></tr tr<>><th style="vertical-align:top; font-weight:normal" id="horiz_white"<>\h
/th<>td headers="matches predef horiz_white">A horizontal whitespace character: [ \t\xA0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000]
</td></tr tr><<>th style="vertical-align:top; font-weight:normal" id="non_horiz_white"\H
<>/th><td headers="predef non_horiz_white">A non-horizontal whitespace character: [^\h]
</td></tr tr><th><style="vertical-align:top; font-weight:normal" id="white"<\s
>/th<>td headers="matches predef white">A whitespace character: \p{IsWhite_Space
}</td></tr tr th><><style="vertical-align:top; font-weight:normal" id="non_white"<\S
>/th><td headers="matches predef non_white"A"A>空白文字以外の文字: [^\s]
/td></tr tr><th><style="vertical-align:top; font-weight:normal" id="vert_white"\v
<>/th><td headers="vert_white>"a vertical whitespace character:<[\n\x0B\f\r\x85\u2028\u2029]
/td></tr tr><th><style="vertical-align:top; font-weight:normal" id="non_vert_white"\V
<>/th><td headers="matches predef non_vert_white"A non-vertical whitespace"><character: [^\v]
/td></tr tr><th><style="vertical-align:top; font-weight:normal" id="word">\w
</th><td headers="matches predef word">A word character: [\p{alpha
\p{gc=Mark}\p{digit}\p{gc=Connector_Punctuation}\p{Join_Control}}</td></tr tr th<>><style="vertical-align:top; font-weight:normal" id="non_word"<>\W
/th<>td headers="matches predef non_<word">単語以外の文字: [^\w]
</td></tr>
<tr><th colspan="2" style="padding-top:20px" id="posix"><b>POSIX 文字クラス (Unicode 対応)</b></th></tr>
<tr><th style="vertical-align:top; font-weight:normal" id="Lower">\p{Lower
}</th><td headers="matches posix Lower">A lower-case alphabetic character: \p{IsLowercase
}</td></tr tr><><th style="vertical-align:top; font-weight:normal" id="Upper">\p{Upper
}</th><td headers="matches posix Upper">An upper-case alphabetic character:\p{IsUppercase
}</td></tr tr><><th style="vertical-align:top; font-weight:normal-align:top; font-weight:normal-align:top" id="ASCII">}/th<>td headers="matches posix ASCII">All ASCII:<[\x00-\x7F]
/td></tr tr<>><th style="vertical-align:top; font-weight:normal" id="Alpha"\p{Alpha
>}</th<>td headers="matches posix Alpha">An alphabetic character:[\p{IsAlphabetic
]}</td></tr tr><<>th style="vertical-align:top; font-weight:normal" id="Digit"\p{IsDigit
>}</th><td headers="matches posix Digit"<\p{ASCII
>10 進数字: \p{gc=Decimal_Number
}</td></tr tr><><th style="vertical-align:top; font-weight:normal" id="Alnum">\p{Alnum
}</th><td headers="matches posix Alnum">An 英数字:[\p{Alpha
\p{Digit}]}</td></tr tr><th><style="vertical-align:top; font-weight:normal" id="Punct">\p{Punct
}</th<>td headers="matches posix Punct">Punctuation: \p{IsPunctuation
}</td></tr th><><style="vertical-align:top;font-weight:normal" id="Graph">}/th><td headers="matches posix Graph">A visible character: [^p{space
\p{gc=Control}\p{gc=Surrogate}\p{gc=Unassigned}]}</td></tr tr><th><style="vertical-align:top; font-weight:normal" id="Print">\p{Print
}</th><td headers="matches posix Print">A printable character: [\p{Graph
\p{Blank}&&[^\p{Cntrl}]]}</td></tr tr<><><\p{Graph
th style="vertical-align:top;font-weight:normal" id="Blank">}/th><td headers="matches posix Blank">A space or a tab: [\p{gc=Space_Separator
\N{CHARACTER TABULATION}]}</td></tr tr><><th style="vertical-align:top; font-weight:normal" id="Cntrl">\p{Cntrl
}</th><td headers="matches posix Cntrl">A control character: \p{gc=Control
}</td></tr tr<>th><style="vertical-align:top; font-weight:normal" id="XDigit<\p{Blank
">}/th><td headers="matches posix XDigit">A 16 進数: [\p{gc=Decimal_Number
\p{IsHex_Digit}}</td></tr tr><<>th style="vertical-align:top; font-weight:normal" id="Space">\p{Space
}</th><td headers="matches posix Space">A whitespace character: \p{IsWhite_Space
}</td></tr tr><th><style="vertical-align:top; font-weight:normal" id="PosixCompatible"><\p{XDigit
POSIX-Compatible expression</th><td headers="matches posix PosixCompatible">See Unicode documentation</td></tr>
<tr><th colspan="2" style="padding-top:20px" id="java">java.lang.Character classes (simple java character type)</th></tr>
<tr><th style="vertical-align:top; font-weight:normal" id="javaLowerCase">\p{javaLowerCase
}</th><td headers="matches java javaLowerCase">Equivalent to java.lang.Character.isLowerCase()</td></tr tr><<>th style="vertical-align:top; font-weight:normal" id="javaUpperCase">\p{javaUpperCase
}</th><td headers="matches java javaUpperCase">Equivalent to java.lang.Character.isUpperCase()</td></tr tr><><th style="vertical-align:top;font-weight:normal" id="javaWhitespace">}/th><td headers="matches java javaWhitespace">Equivalent to java.lang.Character.isWhitespace()</td></tr tr><><th style="vertical-align:top; font-weight:normal" id="javaMirrored">\p{javaMirrored
}</th><td headers="matches java javaMirrored">Equivalent to java.lang.Character.isMirrored()</td></tr<\p{javaWhitespace
>
<tr><th colspan="2" style="padding-top:20px" id="unicode"Unicode">Unicode スクリプト、ブロック、カテゴリ、バイナリ プロパティ</th></tr のクラス>
<tr><th style="vertical-align:top; font-weight:normal" id="IsLatin">\p{IsLatin
}</th><td headers="matches unicode IsLatin">A Latin script character (script)</td></tr tr<>th><style="vertical-align:top; font-weight:normal" id="InGreek">\p{InGreek
}</th><td headers="matches unicode InGreek">A character in the greek block (block)</td></tr tr<>th><style="vertical-align:top; font-weight:normal" id="Lu">\p{Lu
}</th><td headers="matches unicode Lu">An uppercase letter (category)</td></tr tr><<>th style="vertical-align:top; font-weight:normal" id="IsAlphabetic">\p{IsAlphabetic
}</th><td headers="matches unicode IsAlphabetic">An alphabetic character (binary property)</td></tr tr tr><><th style="vertical-align:top;font-weight:normal" id="Sc">}/th><td headers="matches unicode Sc">A currency symbol</td></tr tr><><th style="vertical-align:top; font-weight:normal" id="not_InGreek">\P{InGreek
}</th><td headers="は unicode not_InGreek">ギリシャ語ブロック内の文字 (否定)</td></tr tr<>th><style="vertical-align:top; font-weight:normal" id="not_uppercase">[\p{L
と一致します<\p{Sc
&&[^\p{Lu}]]}</th<>td headers="matches unicode not_uppercase">大文字 (減算)</td/tr を除く任意の><文字>
<tr><th colspan="2" style="padding-top:20px" id="bounds">Boundary matchers</th></tr>
<tr><th style="vertical-align:top; font-weight:normal" id="begin_line"<^
>/th<>td headers="matches bounds begin_line">The beginning of a line</td></tr tr><><th style="vertical-align:top; font-weight:normal" id="end_line">$
</th><td headers="matches bounds end_line">The end of a line</td></tr tr<>th><style="vertical-align:top; font-weight:normal" id="word_boundary">\b
</th><td headers="word_boundary境界に一致します">A word boundary</td></tr tr>><<th style="vertical-align:top; font-weight:normal" id="non_word_boundary"\B
></th><td headers="matches bounds non_word_boundary">A non-word boundary</td></tr tr><th><style="vertical-align:top; font-weight:normal" id="begin_input"\A
<>/th><td headers="matches bounds boundsbegin_input">input/td></tr tr><th><style="vertical-align:top; font-weight:normal" id="end_prev_match">\G
</th><td headers="matchs bounds end_prev_match">The end of the previous match</td></tr tr th>><<style="vertical-align:top; font-weight:normal" id="end_input_except_term"\Z
<>/th><td headers="matchs bounds end_input_except_term"><入力の終わりですが、最終的なターミネータの場合 any</td></tr tr<>th><style="vertical-align:top; font-weight:normal" id="end_input">\z
</th<>td headers="matches bounds end_input">The end of the input</td></tr>
<tr><th colspan="2" style="padding-top:20px" id="linebreak">Linebreak matcher</th></tr>
<tr><th style="vertical-align:top; font-weight:normal" id="any_unicode_linebreak"\R
<>/th><td headers="matches linebreak any_unicode_linebreak">Any Unicode linebreak sequence, is equivalent to \u000D\u000A|[\u000A\u000B\u000C\u000D\u0085\u2028\u2029]
</td></tr>
<tr><th colspan="2" style="padding-top:20px" id="grapheme">Unicode Extended Grapheme matcher</th></tr>
<tr><th style="vertical-align:top; font-weight:normal" id="grapheme_any">\X
</th<>td headers="matches grapheme grapheme_any">Any Unicode extended grapheme cluster</td></tr>
<tr><th colspan="2" style="padding-top:20px" id="greedy">Greedy 量指定子</th></tr>
<tr><th style="vertical-align:top; font-weight:normal" id="greedy_once_or_not">X?
</th><td headers=greedy_once_or_not>"x,once or not< all/td></tr tr><><th style="vertical-align:top; font-weight:normal" id="greedy_zero_or_more">X*
</th><td headers="matches greedy greedy_zero_or_more">X, zero or more times</td/td/trd/trd><><tr><th style="vertical-align:top; font-weight:normal" id="greedy_one_or_more">X+
</th<>td headers="matches greedy greedy_one_or_more">X, one or more times</td></tr tr>><<th style="vertical-align:top; font-weight:normal" id="greedy_exactly">X{
n<}
/th<>td headers="matches greedy greedy_exactly">X, exactly n times</td></tr tr><><th style="vertical-align:top; font-weight:normal" id="greedy_at_least">X{
n,
}</th><td headers="matches greedy greedy_at_least">X, least n times</td></tr tr><th><style="vertical-align:top; font-weight:normal" id="greedy_at_least_up_to">X{
n,
m}
</th><td headers="matches greedy greedy_at_least_up_to">X, least n but more than m times</td></tr>
<tr><th colspan="2" style="padding-top:20px" id="reluc">Reluctant 量指定子</th></tr>
<tr><th style="vertical-align:top; font-weight:normal" id="reluc_once_or_not">X??
</th<>td headers="reluc reluc_once_or_not">X, once at all</td></tr tr><th><style="vertical-align:top; font-weight:normal" id="reluc_zero_or_more">X*?
</th<>td headers="matches reluc reluc_zero_or_more">X, zero or more times</td></tr tr tr><><th style="vertical-align:top;font-weight:normal" id="reluc_one_or_more">X+?
</th><td headers="matches reluc reluc_one_or_more">X, one or more times</td></tr tr><th><style="vertical-align:top; font-weight:normal" id="reluc_exactly">X{
n}?
</th<>td headers="matches reluc reluc_exactly">X, exactly n times</td></tr tr tr><><th style="vertical-align:top;font-weight:normal" id="reluc_at_least">X{
n,}?
</th<>td headers="は reluc reluc_at_least">X, least n times</td></tr tr<>th><style="vertical-align:top; font-weight:normal" id="reluc_at_least_up_to">X{
n,
m}?
</th<>td headers="matches reluc reluc_at_least_up_to">X, least n nただし、m 回</td></tr 以下>
<tr><th colspan="2" style="padding-top:20px" id="poss">所有量指定子</th></tr>
<tr><th style="vertical-align:top; font-weight:normal" id="poss_once_or_not">X?+
</th><td headers="matches poss poss_once_or_not">X, once at all</td></tr tr>><<th style="vertical-align:top; font-weight:normal" id="poss_zero_or_more">X<*+
/th<>td headers="matches poss poss_zero_or_more">X, zero more times</td/tr/trd></tr><><th style="vertical-align:top;font-weight:normal" id="poss_one_or_more">X++
</th><td headers="matches poss poss_one_or_more">X, one or more times</td></tr tr><th><style="vertical-align:top; font-weight:normal" id="poss_exactly">X{
n}+
</th<>td headers="matches poss poss_exactly">X, exactly n times</td></tr tr tr><><th style="vertical-align:top;font-weight:normal" id="poss_at_least">X{
n,}+
</th<>td headers="matches poss poss_at_least">X, least n times</td></tr tr<>th><style="vertical-align:top; font-weight:normal" id="poss_at_least_up_to">X{
n,
m}+
</th><td headers="matches poss poss_at_least_up_to">X, least n nただし、m 回</td></tr 以下>
<tr><th colspan="2" style="padding-top:20px" id="logical">Logical operators</th></tr>
<tr><th style="vertical-align:top; font-weight:normal" id="concat">XY</th><td headers="matches logical concat">X とそれに続く Y</td></tr tr><><th style="vertical-align:top; font-weight:normal" id="alternate">X|
Y</th><td headers="matches logical alternate">Either X or Y</td></tr tr tr>tr><<th style="vertical-align:top;font-weight:normal" id="group">(
X)
</th><td headers="matches logical group">X, as a capturing group</td></tr>
<tr><th colspan="2" style="padding-top:20px" id="backref">Back references</th></tr>
<tr><th style="vertical-align:top; font-weight:normal" id="back_nth"\
>n</th><td headers="matchs backref back_nth">Whatever the n<sup>th</sup> capturing group matched</td></tr tr><th><style="vertical-align:top; font-weight:normal" id="back_named">\
k<name></th><td headers="は backref back_named">名前付きキャプチャ グループ "name" と一致するものに一致します。 API 26 以上</td></tr でのみ使用できます>
<tr><th colspan="2" style="padding-top:20px" id="quote">Quote</th></tr>
<tr><th style="vertical-align:top; font-weight:normal" id="quote_follow">\
</th<>td headers="は引用符 quote_follow">Nothing と一致しますが、次の文字</td></tr tr><><th style="vertical-align:top; font-weight:normal" id="quote_begin"><\Q
/th<>td headers="nothing"> quote_begin に一致しますが、/td></tr/tr<>>< まで\E
<すべての文字を引用符で囲みますth style="vertical-align:top;font-weight:normal" id="quote_end">\E
</th<>td headers="は引用符 quote_end"Nothing に>一致しますが<\Q
、/td></tr><-- Metachars: !$()*+.?<>[\]^{|}-->
<tr><th colspan="2" style="padding-top:20px" id="special">Special constructs (named-capturing and non-capturing)</th></tr>
<tr><th style="vertical-align:top; font-weight:normal" id="named_group"(?<<a href="#groupname">name</a>>
>X)
</th><td headers="matches special named_group">X, as a named-capturing group. API 26 以降でのみ使用できます。</td></tr tr><><th style="vertical-align:top; font-weight:normal" id="non_capture_group">(?:
X)
</th><td headers="は、non_capture_group> キャプチャされていないグループ</td></tr tr><th><style="vertical-align:top; font-weight:normal" id="flags"><(?idmsux-idmsux)
/th> sU on - off</td></tr tr><th><style="vertical-align:top; font-weight:" normal id="non_capture_group_flags">(?idmsuxU-idmsuxU:
X)
</th><td headers="matches special non_capture_group_flags">X, off</td></><tr tr tr<><>th style="vertical-align:top; font-weight:normal" id="pos_lookahead"><c(?=</c><i>X</i><c>)</c>></th><td headers="は、特殊なpos_lookahead "><i>X</i>" と一致します。ゼロ幅の正の先<読み/td/><tr><tr><th style="vertical-align:top; font-weight:normal" id="neg_lookahead"><c>(?!</c><i>X</i><c>)</c></th><td headers="matches special neg_lookahead"><i>X</i>, ゼロ幅の負の先読<み/td></tr tr><th><style="vertical-align:top; font-weight:normal" id="pos_lookbehind"><c>(?<=</c><i>X</i><c>)</c></th<>td headers="matches special pos_lookbehind"><i>X</i>, via zero-widthpositive lookbehind</td></tr tr><th><style="vertical-align:top; font-weight:normal" id="neg_lookbehind"><c>(?<!</c><i>X</i><c>)</c></th><td headers="は、neg_lookbehind><>< 0 幅の負の lookbehind</td></>tr tr><<>th style="vertical-align:top; font-weight:normal" id="indep_non_capture_group"><c>(?></c><i>X</i><c>)</c></th><td headers="は、独立した非キャプチャ グループ</td></tr として、特殊なindep_non_capture_group"i>X</i>">< と一致します>
</tbody></table>
<時間>
<h2>"bs">円記号、エスケープ、および引用符</h2>
円記号文字 ('\'
) は、上記の表で定義されているようにエスケープされたコンストラクトを導入し、それ以外の場合はエスケープされていないコンストラクトとして解釈される文字を引用符で囲むのに役立ちます。 したがって、式 \\
は 1 つの円記号と一致し、左中かっこと \{
一致します。
エスケープされたコンストラクトを示さないアルファベット文字の前に円記号を使用することはエラーです。これらは、正規表現言語の将来の拡張のために予約されています。 バックスラッシュは、その文字がエスケープされていないコンストラクトの一部であるかどうかに関係なく、アルファベット以外の文字の前に使用できます。
Java ソース コード内の文字列リテラル内の円記号は、cite>The Java Language Specification</cite> を Unicode エスケープとして解釈します <(セクション {
1.4 で追加されました。
の java.util.regex.Pattern
Java ドキュメント。
このページの一部は、によって作成および共有された作業に基づく変更であり、に記載されている条件に従って使用されます。
フィールド
CanonEq |
古い.
このフラグは Android ではサポートされていません。 |
CaseInsensitive |
古い.
大文字と小文字を区別しない照合を有効にします。 |
Comments |
古い.
パターン内の空白とコメントを許可します。 |
Dotall |
古い.
dotall モードを有効にします。 |
Literal |
古い.
パターンのリテラル解析を有効にします。 |
Multiline |
古い.
複数行モードを有効にします。 |
UnicodeCase |
古い.
Unicode 対応のケース フォールディングを有効にします。 |
UnicodeCharacterClass |
古い.
このフラグは Android ではサポートされておらず、Unicode 文字クラスは常に使用されます。 |
UnixLines |
古い.
Unix 行モードを有効にします。 |
プロパティ
Class |
この |
Handle |
基になる Android インスタンスへのハンドル。 (継承元 Object) |
JniIdentityHashCode |
正規表現のコンパイル済み表現。 (継承元 Object) |
JniPeerMembers |
正規表現のコンパイル済み表現。 |
PeerReference |
正規表現のコンパイル済み表現。 (継承元 Object) |
ThresholdClass |
この API は Mono for Android インフラストラクチャをサポートしており、コードから直接使用するためのものではありません。 (継承元 Object) |
ThresholdType |
この API は Mono for Android インフラストラクチャをサポートしており、コードから直接使用するためのものではありません。 (継承元 Object) |
メソッド
AsMatchPredicate() |
このパターンが特定の入力文字列と一致するかどうかをテストする述語を作成します。 |
AsPredicate() |
指定された入力文字列でこのパターンが見つかったかどうかをテストする述語を作成します。 |
Clone() |
このオブジェクトのコピーを作成して返します。 (継承元 Object) |
Compile(String) |
指定された正規表現をパターンにコンパイルします。 |
Compile(String, RegexOptions) |
指定された正規表現を、指定されたフラグを持つパターンにコンパイルします。 |
Dispose() |
正規表現のコンパイル済み表現。 (継承元 Object) |
Dispose(Boolean) |
正規表現のコンパイル済み表現。 (継承元 Object) |
Equals(Object) |
他のオブジェクトがこのオブジェクトと "等しい" かどうかを示します。 (継承元 Object) |
Flags() |
このパターンの一致フラグを返します。 |
GetHashCode() |
オブジェクトのハッシュ コード値を返します。 (継承元 Object) |
InvokePattern() |
このパターンのコンパイル元の正規表現を返します。 |
JavaFinalize() |
オブジェクトへの参照がなくなったとガベージ コレクションが判断したときに、オブジェクトのガベージ コレクターによって呼び出されます。 (継承元 Object) |
Matcher(ICharSequence) |
指定した入力をこのパターンと一致させるマッチャーを作成します。 |
Matcher(String) |
指定した入力をこのパターンと一致させるマッチャーを作成します。 |
Matches(String, ICharSequence) |
指定された正規表現をコンパイルし、指定された入力を照合しようとします。 |
Matches(String, String) |
指定された正規表現をコンパイルし、指定された入力を照合しようとします。 |
Notify() |
このオブジェクトのモニターで待機している 1 つのスレッドを起動します。 (継承元 Object) |
NotifyAll() |
このオブジェクトのモニターで待機しているすべてのスレッドを起動します。 (継承元 Object) |
Quote(String) |
指定した のリテラル パターン |
SetHandle(IntPtr, JniHandleOwnership) |
Handle プロパティを設定します。 (継承元 Object) |
Split(ICharSequence) |
指定された入力シーケンスを、このパターンの一致に分割します。 |
Split(ICharSequence, Int32) |
指定された入力シーケンスを、このパターンの一致に分割します。 |
Split(String) |
指定された入力シーケンスを、このパターンの一致に分割します。 |
Split(String, Int32) |
指定された入力シーケンスを、このパターンの一致に分割します。 |
ToArray<T>() |
正規表現のコンパイル済み表現。 (継承元 Object) |
ToString() |
オブジェクトの文字列形式を返します。 (継承元 Object) |
UnregisterFromRuntime() |
正規表現のコンパイル済み表現。 (継承元 Object) |
Wait() |
現在のスレッドが起動するまで待機します。通常<は、通知</em> または>< em 中断</em によって待機します>。> (継承元 Object) |
Wait(Int64) |
現在のスレッドが起動するまで待機します。通常<は、通知></em> または <>em 中断</em>、または特定のリアルタイムが経過するまで待機します。 (継承元 Object) |
Wait(Int64, Int32) |
現在のスレッドが起動するまで待機します。通常<は、通知></em> または <>em 中断</em>、または特定のリアルタイムが経過するまで待機します。 (継承元 Object) |
明示的なインターフェイスの実装
IJavaPeerable.Disposed() |
正規表現のコンパイル済み表現。 (継承元 Object) |
IJavaPeerable.DisposeUnlessReferenced() |
正規表現のコンパイル済み表現。 (継承元 Object) |
IJavaPeerable.Finalized() |
正規表現のコンパイル済み表現。 (継承元 Object) |
IJavaPeerable.JniManagedPeerState |
正規表現のコンパイル済み表現。 (継承元 Object) |
IJavaPeerable.SetJniIdentityHashCode(Int32) |
正規表現のコンパイル済み表現。 (継承元 Object) |
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) |
正規表現のコンパイル済み表現。 (継承元 Object) |
IJavaPeerable.SetPeerReference(JniObjectReference) |
正規表現のコンパイル済み表現。 (継承元 Object) |
拡張メソッド
JavaCast<TResult>(IJavaObject) |
Android ランタイムチェック型変換を実行します。 |
JavaCast<TResult>(IJavaObject) |
正規表現のコンパイル済み表現。 |
GetJniTypeName(IJavaPeerable) |
正規表現のコンパイル済み表現。 |