java.util.regex
Class Pattern

java.lang.Object
  extended by java.util.regex.Pattern

public class Pattern
extends java.lang.Object


Field Summary
static int CANON_EQ
          Ignored in this version of this implementation
static int CASE_INSENSITIVE
          Like the /i flag in perl
static int COMMENTS
          Like the /x flag in perl
static int DOTALL
          Like the /s flag in perl
static int LITERAL
          Turns off recognition of all metacharacters
static int MULTILINE
          Like the /m flag in perl
static int UNICODE_CASE
          Perl 5.8 semantics instead of perl 5.004 semantics; but ignored in this implementation
static int UNIX_LINES
          Ignored in this implementation
 
Method Summary
static Pattern compile(java.lang.String s)
           
static Pattern compile(java.lang.String s, int flags)
           
 int flags()
           
 Matcher matcher(String seq)
          Prepare to match this pattern against the given subject string.
static boolean matches(String pat, String seq)
          Indicate whether the given pattern matches the given subject string.
 java.lang.String pattern()
           
static java.lang.String quote(java.lang.String s)
           
 String[] split(String seq)
          Return the strings seperated by the given delimiter-expression.
 String[] split(String seq, int count)
          Return the strings separated by the given delimiter-expression.
 java.lang.String toString()
           
 

Field Detail

UNIX_LINES

public static final int UNIX_LINES
Ignored in this implementation

See Also:
Constant Field Values

CASE_INSENSITIVE

public static final int CASE_INSENSITIVE
Like the /i flag in perl

See Also:
Constant Field Values

COMMENTS

public static final int COMMENTS
Like the /x flag in perl

See Also:
Constant Field Values

MULTILINE

public static final int MULTILINE
Like the /m flag in perl

See Also:
Constant Field Values

LITERAL

public static final int LITERAL
Turns off recognition of all metacharacters

See Also:
Constant Field Values

DOTALL

public static final int DOTALL
Like the /s flag in perl

See Also:
Constant Field Values

UNICODE_CASE

public static final int UNICODE_CASE
Perl 5.8 semantics instead of perl 5.004 semantics; but ignored in this implementation

See Also:
Constant Field Values

CANON_EQ

public static final int CANON_EQ
Ignored in this version of this implementation

See Also:
Constant Field Values
Method Detail

compile

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

compile

public static Pattern compile(java.lang.String s,
                              int flags)

pattern

public java.lang.String pattern()

toString

public java.lang.String toString()

matcher

public Matcher matcher(String seq)
Prepare to match this pattern against the given subject string. A Pattern may be shared between threads, while a Matcher may not.

Parameters:
seq - The subject string. Note that this is a CharSequence in Sun Java 1.5.

flags

public int flags()

matches

public static boolean matches(String pat,
                              String seq)
Indicate whether the given pattern matches the given subject string.

Parameters:
pat - A regular expression
seq - The target string. Note that this is a CharSequence in Sun Java 1.5.

split

public String[] split(String seq,
                      int count)
Return the strings separated by the given delimiter-expression.

Parameters:
seq - The subject string. Note that this is a CharSequence in Sun Java 1.5.
count - The maximum number of groups to produce.

split

public String[] split(String seq)
Return the strings seperated by the given delimiter-expression.

Parameters:
seq - The subject string. Note that this is a CharSequence in Sun Java 1.5.

quote

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