uvascript
Class Regex

java.lang.Object
  extended byuvascript.Regex

public class Regex
extends java.lang.Object

Regular expression. An adapter class to the java.util.regex package provided since JDK 1.4.


Constructor Summary
Regex()
           
 
Method Summary
static Match find(java.lang.String target, java.lang.String pattern, boolean ignoreCase)
          Finds the substring matched to the given pattern.
static java.lang.String[] findGroups(java.lang.String target, java.lang.String pattern, boolean ignoreCase)
          Searches the given string to find groups specified by parentheses.
static java.lang.String replaceAll(java.lang.String target, java.lang.String pattern, java.lang.String substitute, boolean ignoreCase)
           
static java.lang.String[] split(java.lang.String target, java.lang.String pattern)
          Splits this string around matches of the given regular expression.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Regex

public Regex()
Method Detail

split

public static java.lang.String[] split(java.lang.String target,
                                       java.lang.String pattern)
Splits this string around matches of the given regular expression.

An invocation of this method yields exactly the same result as the call to String.split(String).


find

public static Match find(java.lang.String target,
                         java.lang.String pattern,
                         boolean ignoreCase)
Finds the substring matched to the given pattern.

Parameters:
target - the character string to be matched.
pattern - regualr expression.
ignoreCase - true if case insensitive.
Returns:
null if the given pattern does not match the string.

findGroups

public static java.lang.String[] findGroups(java.lang.String target,
                                            java.lang.String pattern,
                                            boolean ignoreCase)
Searches the given string to find groups specified by parentheses. The group 0 represets the matched string.

Parameters:
target - the text string to be matched.
pattern - regular expression.
ignoreCase - true if case insensitive.
Returns:
a list of the groups.

replaceAll

public static java.lang.String replaceAll(java.lang.String target,
                                          java.lang.String pattern,
                                          java.lang.String substitute,
                                          boolean ignoreCase)


UvaScript. Copyright (C) 2004 Shigeru Chiba. All Rights Reserved.