SAP NetWeaver '04

com.sapportals.wcm.util.regex
Class Pattern

[contained in: com.sap.netweaver.bc.util.par - bc.util.public_api.jar]
java.lang.Object
  |
  +--com.sapportals.wcm.util.regex.Pattern

public class Pattern
extends java.lang.Object

Provides a pattern object for matching strings.


Field Summary
static int CANON_EQ
          Enables canonical equivalence.
static int CASE_INSENSITIVE
          Enables case-insensitive matching.
static int COMMENTS
          Permits whitespace and comments in pattern.
static int DOTALL
          Enables dotall mode.
static int MULTILINE
          Enables multiline mode.
static int UNICODE_CASE
          Enables Unicode-aware case folding.
static int UNIX_LINES
          Enables Unix lines mode.
 
Constructor Summary
Pattern(java.lang.String pattern)
           
Pattern(java.lang.String pattern, int flags)
           
 
Method Summary
static Pattern compile(java.lang.String regex)
          Compiles the given regular expression into a pattern.
static Pattern compile(java.lang.String regex, int flags)
          Compiles the given regular expression into a pattern with the given flags.
 int flags()
          Returns this pattern's match flags.
protected  RE getExpression()
           
 Matcher matcher(CharSequence input)
          Creates a matcher that will match the given input against this pattern.
 Matcher matcher(java.lang.String input)
          Creates a matcher that will match the given input against this pattern.
static boolean matches(java.lang.String regex, CharSequence input)
          Compiles the given regular expression and attempts to match the given input against it.
 java.lang.String pattern()
          Returns the regular expression from which this pattern was compiled.
 java.lang.String[] split(CharSequence input)
          Splits the given input sequence around matches of this pattern.
 java.lang.String[] split(CharSequence input, int limit)
          Splits the given input sequence around matches of this pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CANON_EQ

public static int CANON_EQ
Enables canonical equivalence.

CASE_INSENSITIVE

public static int CASE_INSENSITIVE
Enables case-insensitive matching.

COMMENTS

public static int COMMENTS
Permits whitespace and comments in pattern.

DOTALL

public static int DOTALL
Enables dotall mode.

MULTILINE

public static int MULTILINE
Enables multiline mode.

UNICODE_CASE

public static int UNICODE_CASE
Enables Unicode-aware case folding.

UNIX_LINES

public static int UNIX_LINES
Enables Unix lines mode.
Constructor Detail

Pattern

public Pattern(java.lang.String pattern)
        throws PatternSyntaxException

Pattern

public Pattern(java.lang.String pattern,
               int flags)
        throws PatternSyntaxException
Method Detail

compile

public static Pattern compile(java.lang.String regex)
                       throws PatternSyntaxException
Compiles the given regular expression into a pattern.
Parameters:
regex - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value
Throws:
PatternSyntaxException - Exception raised in failure situation

compile

public static Pattern compile(java.lang.String regex,
                              int flags)
                       throws PatternSyntaxException
Compiles the given regular expression into a pattern with the given flags.
Parameters:
regex - TBD: Description of the incoming method parameter
flags - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value
Throws:
PatternSyntaxException - Exception raised in failure situation

flags

public int flags()
Returns this pattern's match flags.
Returns:
TBD: Description of the outgoing return value

matcher

public Matcher matcher(CharSequence input)
Creates a matcher that will match the given input against this pattern.
Parameters:
input - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value

matcher

public Matcher matcher(java.lang.String input)
Creates a matcher that will match the given input against this pattern.
Parameters:
input - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value

matches

public static boolean matches(java.lang.String regex,
                              CharSequence input)
                       throws PatternSyntaxException
Compiles the given regular expression and attempts to match the given input against it.
Parameters:
regex - TBD: Description of the incoming method parameter
input - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value
Throws:
PatternSyntaxException - Exception raised in failure situation

pattern

public java.lang.String pattern()
Returns the regular expression from which this pattern was compiled.
Returns:
TBD: Description of the outgoing return value

split

public java.lang.String[] split(CharSequence input)
Splits the given input sequence around matches of this pattern.
Parameters:
input - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value

split

public java.lang.String[] split(CharSequence input,
                                int limit)
Splits the given input sequence around matches of this pattern.
Parameters:
input - TBD: Description of the incoming method parameter
limit - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value

getExpression

protected RE getExpression()

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.