Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.adfnmc.java.util.regex
Class Pattern

java.lang.Object
  extended by oracle.adfnmc.java.util.regex.Pattern
All Implemented Interfaces:
Serializable

public final class Pattern
extends java.lang.Object
implements Serializable

Pattern implements a compiler for regular expressions as defined by the J2SE specification. The regular expression syntax is largely similar to the syntax defined by Perl 5 but has both omissions and extensions. A formal and complete definition of the regular expression syntax is not provided by the J2SE speTBD (TODO)


Field Summary
static int CANON_EQ
           
static int CASE_INSENSITIVE
           
static java.lang.Class CLASS_INSTANCE
           
static int COMMENTS
           
static int DOTALL
           
static int LITERAL
           
static int MULTILINE
           
static int UNICODE_CASE
           
static int UNIX_LINES
           
 
Method Summary
static Pattern compile(java.lang.String pattern)
           
static Pattern compile(java.lang.String regex, int flags)
          Return a compiled pattern corresponding to the input regular expression string.
 int flags()
          Return the mask of flags used to compile the pattern
 Matcher matcher(java.lang.String cs)
          Create a matcher for this pattern and a given input character sequence
static boolean matches(java.lang.String regex, java.lang.String input)
           
 java.lang.String pattern()
          Returns the pattern string passed to the compile method
static java.lang.String quote(java.lang.String s)
           
 java.lang.String[] split(java.lang.String input)
           
 java.lang.String[] split(java.lang.String input, int limit)
          Split an input string using the pattern as a token separator.
 java.lang.String toString()
          Return a textual representation of the pattern.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_INSTANCE

public static final java.lang.Class CLASS_INSTANCE

UNIX_LINES

public static final int UNIX_LINES
See Also:
Constant Field Values

CASE_INSENSITIVE

public static final int CASE_INSENSITIVE
See Also:
Constant Field Values

COMMENTS

public static final int COMMENTS
See Also:
Constant Field Values

MULTILINE

public static final int MULTILINE
See Also:
Constant Field Values

LITERAL

public static final int LITERAL
See Also:
Constant Field Values

DOTALL

public static final int DOTALL
See Also:
Constant Field Values

UNICODE_CASE

public static final int UNICODE_CASE
See Also:
Constant Field Values

CANON_EQ

public static final int CANON_EQ
See Also:
Constant Field Values
Method Detail

matcher

public Matcher matcher(java.lang.String cs)
Create a matcher for this pattern and a given input character sequence

Parameters:
cs - The input character sequence
Returns:
A new matcher

split

public java.lang.String[] split(java.lang.String input,
                                int limit)
Split an input string using the pattern as a token separator.

Parameters:
input - Input sequence to tokenize
limit - If positive, the maximum number of tokens to return. If negative, an indefinite number of tokens are returned. If zero, an indefinite number of tokens are returned but trailing empty tokens are excluded.
Returns:
A sequence of tokens split out of the input string.

split

public java.lang.String[] split(java.lang.String input)

pattern

public java.lang.String pattern()
Returns the pattern string passed to the compile method

Returns:
A string representation of the pattern

toString

public java.lang.String toString()
Return a textual representation of the pattern.

Overrides:
toString in class java.lang.Object
Returns:
The regular expression string

flags

public int flags()
Return the mask of flags used to compile the pattern

Returns:
A mask of flags used to compile the pattern.

compile

public static Pattern compile(java.lang.String regex,
                              int flags)
                       throws PatternSyntaxException
Return a compiled pattern corresponding to the input regular expression string. The input flags is a mask of the following flags:
UNIX_LINES (0x0001)
Enables UNIX lines mode where only \n is recognized as a line terminator. The default setting of this flag is off indicating that all of the following character sequences are recognized as line terminators: \n, \r, \r\n, NEL (\u0085), \u2028 and \u2029.
CASE_INSENSITIVE (0x0002)
Directs matching to be done in a way that ignores differences in case. If input character sequences are encoded in character sets other than ASCII, then the UNICODE_CASE must also be set to enable Unicode case detection.
UNICODE_CASE (0x0040)
Enables Unicode case folding if used in conjunction with the CASE_INSENSITIVE flag. If CASE_INSENSITIVE is not set, then this flag has no effect.
COMMENTS (0x0004)
Directs the pattern compiler to ignore whitespace and comments in the pattern. Whitespace consists of sequences including only these characters: SP (\u0020), HT (\t or \u0009), LF (\n or ), VT (\u000b), FF (\f or \u000c), and CR (\r or ). A comment is any sequence of characters beginning with the "#" (\u0023) character and ending in a LF character.
MULTILINE (0x0008)
Turns on multiple line mode for matching of character sequences. By default, this mode is off so that the character "^" (\u005e) matches the beginning of the entire input sequence and the character "$" (\u0024) matches the end of the input character sequence. In multiple line mode, the character "^" matches any character in the input sequence which immediately follows a line terminator and the character "$" matches any character in the input sequence which immediately precedes a line terminator.
DOTALL (0x0020)
Enables the DOT (".") character in regular expressions to match line terminators. By default, line terminators are not matched by DOT.
CANON_EQ (0x0080)
Enables matching of character sequences which are canonically equivalent according to the Unicode standard. Canonical equivalence is described here: http://www.unicode.org/reports/tr15/. By default, canonical equivalence is not detected while matching.

Parameters:
regex - A regular expression string.
flags - A set of flags to control the compilation of the pattern.
Returns:
A compiled pattern
Throws:
PatternSyntaxException - If the input regular expression does not match the required grammar.

compile

public static Pattern compile(java.lang.String pattern)

matches

public static boolean matches(java.lang.String regex,
                              java.lang.String input)

quote

public static java.lang.String quote(java.lang.String s)

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.