Pattern Class

Definition

A compiled representation of a regular expression.

[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
Inheritance
Pattern
Attributes
Implements

Remarks

A compiled representation of a regular expression.

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 Matcher object that can match arbitrary 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.

A typical invocation sequence is thus

<blockquote>

Pattern p = Pattern.{@link #compile compile}("a*b");
            Matcher m = p.{@link #matcher matcher}("aaaaab");
            boolean b = m.{@link Matcher#matches matches}();

</blockquote>

A #matches matches method is defined by this class as a convenience for when a regular expression is used just once. This method compiles an expression and matches an input sequence against it in a single invocation. The statement

<blockquote>

boolean b = Pattern.matches("a*b", "aaaaab");

</blockquote>

is equivalent to the three statements above, though for repeated matches it is less efficient since it does not allow the compiled pattern to be reused.

Instances of this class are immutable and are safe for use by multiple concurrent threads. Instances of the Matcher class are not safe for such use.

<h2>"sum">Summary of regular-expression constructs</h2>

<table class="borderless"> <caption style="display:none">Regular expression constructs, and what they match</caption> <thead style="text-align:left"> <tr> <th id="construct">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 characters 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">\0n</th> <td headers="matches characters octal_n">The character with octal value 0n (0&nbsp;<=&nbsp;n&nbsp;<=&nbsp;7)</td></tr> <tr><th style="vertical-align:top; font-weight: normal" id="octal_nn">\0nn</th> <td headers="matches characters octal_nn">The character with octal value 0nn (0&nbsp;<=&nbsp;n&nbsp;<=&nbsp;7)</td></tr> <tr><th style="vertical-align:top; font-weight: normal" id="octal_nnn">\0mnn</th> <td headers="matches characters octal_nnn">The character with octal value 0mnn (0&nbsp;<=&nbsp;m&nbsp;<=&nbsp;3, 0&nbsp;<=&nbsp;n&nbsp;<=&nbsp;7)</td></tr> <tr><th style="vertical-align:top; font-weight: normal" id="hex_hh">\xhh</th> <td headers="matches characters hex_hh">The character with hexadecimal value 0xhh</td></tr> <tr><th style="vertical-align:top; font-weight: normal" id="hex_hhhh">&#92;uhhhh</th> <td headers="matches characters hex_hhhh">The character with hexadecimal&nbsp;value&nbsp;0xhhhh</td></tr> <tr><th style="vertical-align:top; font-weight: normal" id="hex_h_h">&#92;x{h...h}</th> <td headers="matches characters hex_h_h">The character with hexadecimal value 0xh...h (java.lang.Character#MIN_CODE_POINT Character.MIN_CODE_POINT &nbsp;&lt;=&nbsp;0xh...h&nbsp;&lt;=&nbsp; java.lang.Character#MAX_CODE_POINT Character.MAX_CODE_POINT)</td></tr> <tr><th style="vertical-align:top; font-weight: normal" id="unicode_name">&#92;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 character ('&#92;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 ('&#92;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 ('&#92;u000D')</td></tr> <tr><th style="vertical-align:top; font-weight:normal" id="form_feed">\f</th> <td headers="matches characters form_feed">The form-feed character ('&#92;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 ('&#92;u0007')</td></tr> <tr><th style="vertical-align:top; font-weight:normal" id="escape">\e</th> <td headers="matches characters escape">The escape character ('&#92;u001B')</td></tr> <tr><th style="vertical-align:top; font-weight:normal" id="ctrl_x">\cx</th> <td headers="matches characters ctrl_x">The control character corresponding to x</td></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><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 through 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="matches predef any">Any character (may or may 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&#92;u1680&#92;u180e&#92;u2000-&#92;u200a&#92;u202f&#92;u205f&#92;u3000]</td></tr> <tr><th style="vertical-align:top; font-weight:normal" id="non_horiz_white">\H</th> <td headers="matches 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 non-whitespace character: [^\s]</td></tr> <tr><th style="vertical-align:top; font-weight:normal" id="vert_white">\v</th> <td headers="matches predef vert_white">A vertical whitespace character: [\n\x0B\f\r\x85&#92;u2028&#92;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">A non-word character: [^\w]</td></tr>

<tr><th colspan="2" style="padding-top:20px" id="posix"><b>POSIX character classes (Unicode-aware)</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" id="ASCII">\p{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">A decimal digit: \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 alphanumeric character:[\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> <tr><th style="vertical-align:top; font-weight:normal" id="Graph">\p{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><th style="vertical-align:top; font-weight:normal" id="Blank">\p{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{XDigit}</th> <td headers="matches posix XDigit">A hexadecimal digit: [\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">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">\p{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>

<tr><th colspan="2" style="padding-top:20px" id="unicode">Classes for Unicode scripts, blocks, categories and binary properties</th></tr>

<tr><th style="vertical-align:top; font-weight:normal" id="IsLatin">\p{IsLatin}</th> <td headers="matches unicode IsLatin">A Latin&nbsp;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&nbsp;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><th style="vertical-align:top; font-weight:normal" id="Sc">\p{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="matches unicode not_InGreek">Any character except one in the Greek block (negation)</td></tr> <tr><th style="vertical-align:top; font-weight:normal" id="not_uppercase">[\p{L&&[^\p{Lu}]]}</th> <td headers="matches unicode not_uppercase">Any letter except an uppercase letter (subtraction)</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="matches bounds 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 begin_input">The beginning of the input</td></tr> <tr><th style="vertical-align:top; font-weight:normal" id="end_prev_match">\G</th> <td headers="matches 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="matches bounds end_input_except_term">The end of the input but for the final terminator, if&nbsp;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 &#92;u000D&#92;u000A|[&#92;u000A&#92;u000B&#92;u000C&#92;u000D&#92;u0085&#92;u2028&#92;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 quantifiers</th></tr>

<tr><th style="vertical-align:top; font-weight:normal" id="greedy_once_or_not">X?</th> <td headers="matches greedy greedy_once_or_not">X, once or not at 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></tr> <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, at 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, at least n but not more than m times</td></tr>

<tr><th colspan="2" style="padding-top:20px" id="reluc">Reluctant quantifiers</th></tr>

<tr><th style="vertical-align:top; font-weight:normal" id="reluc_once_or_not">X??</th> <td headers="matches reluc reluc_once_or_not">X, once or not 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><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><th style="vertical-align:top; font-weight:normal" id="reluc_at_least">X{n,}?</th> <td headers="matches reluc reluc_at_least">X, at 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, at least n but not more than m times</td></tr>

<tr><th colspan="2" style="padding-top:20px" id="poss">Possessive quantifiers</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 or not 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 or more times</td></tr> <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><th style="vertical-align:top; font-weight:normal" id="poss_at_least">X{n,}+</th> <td headers="matches poss poss_at_least">X, at 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, at least n but not more than m times</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 followed by 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><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="matches 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&lt;name&gt;</th> <td headers="matches backref back_named">Whatever the named-capturing group "name" matched. Only available for API 26 or above</td></tr>

<tr><th colspan="2" style="padding-top:20px" id="quote">Quotation</th></tr>

<tr><th style="vertical-align:top; font-weight:normal" id="quote_follow">\</th> <td headers="matches quote quote_follow">Nothing, but quotes the following character</td></tr> <tr><th style="vertical-align:top; font-weight:normal" id="quote_begin">\Q</th> <td headers="matches quote quote_begin">Nothing, but quotes all characters until \E</td></tr> <tr><th style="vertical-align:top; font-weight:normal" id="quote_end">\E</th> <td headers="matches quote quote_end">Nothing, but ends quoting started by \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">(?&lt;<a href="#groupname">name</a>&gt;X)</th> <td headers="matches special named_group">X, as a named-capturing group. Only available for API 26 or above.</td></tr> <tr><th style="vertical-align:top; font-weight:normal" id="non_capture_group">(?:X)</th> <td headers="matches special non_capture_group">X, as a non-capturing group</td></tr> <tr><th style="vertical-align:top; font-weight:normal" id="flags">(?idmsux-idmsux)&nbsp;</th> sU on - off</td></tr> <tr><th style="vertical-align:top; font-weight:normal" id="non_capture_group_flags">(?idmsuxU-idmsuxU:X)&nbsp;&nbsp;</th> <td headers="matches special non_capture_group_flags">X, as a non-capturing group with the given flags du</a > U on - off</td></tr> <tr><th style="vertical-align:top; font-weight:normal" id="pos_lookahead"><c>(?=</c><i>X</i><c>)</c></th> <td headers="matches special pos_lookahead"><i>X</i>, via zero-width positive lookahead</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>, via zero-width negative lookahead</td></tr> <tr><th style="vertical-align:top; font-weight:normal" id="pos_lookbehind"><c>(?&lt;=</c><i>X</i><c>)</c></th> <td headers="matches special pos_lookbehind"><i>X</i>, via zero-width positive lookbehind</td></tr> <tr><th style="vertical-align:top; font-weight:normal" id="neg_lookbehind"><c>(?&lt;!</c><i>X</i><c>)</c></th> <td headers="matches special neg_lookbehind"><i>X</i>, via zero-width negative lookbehind</td></tr> <tr><th style="vertical-align:top; font-weight:normal" id="indep_non_capture_group"><c>(?&gt;</c><i>X</i><c>)</c></th> <td headers="matches special indep_non_capture_group"><i>X</i>, as an independent, non-capturing group</td></tr>

</tbody> </table>

<hr>

<h2>"bs"&gt;Backslashes, escapes, and quoting</h2>

The backslash character ('\') serves to introduce escaped constructs, as defined in the table above, as well as to quote characters that otherwise would be interpreted as unescaped constructs. Thus the expression \\ matches a single backslash and \{ matches a left brace.

It is an error to use a backslash prior to any alphabetic character that does not denote an escaped construct; these are reserved for future extensions to the regular-expression language. A backslash may be used prior to a non-alphabetic character regardless of whether that character is part of an unescaped construct.

Backslashes within string literals in Java source code are interpreted as required by <cite>The Java Language Specification</cite> as either Unicode escapes (section {

Added in 1.4.

Java documentation for java.util.regex.Pattern.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Fields

CanonEq
Obsolete.

This flag is not supported on Android.

CaseInsensitive
Obsolete.

Enables case-insensitive matching.

Comments
Obsolete.

Permits whitespace and comments in pattern.

Dotall
Obsolete.

Enables dotall mode.

Literal
Obsolete.

Enables literal parsing of the pattern.

Multiline
Obsolete.

Enables multiline mode.

UnicodeCase
Obsolete.

Enables Unicode-aware case folding.

UnicodeCharacterClass
Obsolete.

This flag is not supported on Android, and Unicode character classes are always used.

UnixLines
Obsolete.

Enables Unix lines mode.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)

Methods

AsMatchPredicate()

Creates a predicate that tests if this pattern matches a given input string.

AsPredicate()

Creates a predicate that tests if this pattern is found in a given input string.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Compile(String, RegexOptions)

Compiles the given regular expression into a pattern with the given flags.

Compile(String)

Compiles the given regular expression into a pattern.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
Flags()

Returns this pattern's match flags.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
InvokePattern()

Returns the regular expression from which this pattern was compiled.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Matcher(ICharSequence)

Creates a matcher that will match the given input against this pattern.

Matcher(String)

Creates a matcher that will match the given input against this pattern.

Matches(String, ICharSequence)

Compiles the given regular expression and attempts to match the given input against it.

Matches(String, String)

Compiles the given regular expression and attempts to match the given input against it.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
Quote(String)

Returns a literal pattern String for the specified String.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
Split(ICharSequence, Int32)

Splits the given input sequence around matches of this pattern.

Split(ICharSequence)

Splits the given input sequence around matches of this pattern.

Split(String, Int32)

Splits the given input sequence around matches of this pattern.

Split(String)

Splits the given input sequence around matches of this pattern.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to