com.raelity.text
Class RegExpJava

java.lang.Object
  extended by com.raelity.text.RegExp
      extended by com.raelity.text.RegExpJava

public class RegExpJava
extends RegExp


Field Summary
 
Fields inherited from class com.raelity.text.RegExp
escape, IGNORE_CASE, matched, optim, PATTERN_NONE, PATTERN_PERL5, PATTERN_SIMPLE
 
Constructor Summary
RegExpJava()
           
 
Method Summary
static boolean canInstantiate()
           
 void compile(String patternString, int compileFlags)
          Prepare this regular expression to use pattern for matching.
static String getAdaptedName()
           
static String getDisplayName()
           
 Pattern getPattern()
          Pick up the underlying java.util.regex.Pattern
 RegExpResult getResult()
          Returns a result object for the last call that used this RegExp for searching an input, for example match.
 String group(int i)
          Get the ith backreference.
 int length(int i)
          The length of the corresponding backreference.
 int nGroup()
          Return the number of backreferences; this is the number of parenthes pairs.
static int patternType()
           
 boolean search(char[] input, int start, int len)
          Search for a match in char array starting at char position start with the indicated length.
 boolean search(String input)
          Search for match.
 boolean search(String input, int start)
          Search for a match in string starting at char position start
 int start(int i)
          The offset from the begining of the input to the start of thespecified group.
 int stop(int i)
          The offset from the begining of the input to the end of the specified group.
 
Methods inherited from class com.raelity.text.RegExp
compile, enableOptimize, isMatch, setEscape
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegExpJava

public RegExpJava()
Method Detail

getDisplayName

public static String getDisplayName()

patternType

public static int patternType()

canInstantiate

public static boolean canInstantiate()

getAdaptedName

public static String getAdaptedName()

getPattern

public Pattern getPattern()
Pick up the underlying java.util.regex.Pattern


compile

public void compile(String patternString,
                    int compileFlags)
             throws RegExpPatternError
Prepare this regular expression to use pattern for matching. The string can begin with "(e?=x)" to specify an escape character.

Specified by:
compile in class RegExp
Parameters:
patternString - The regular expression.
Throws:
RegExpPatternError - This is thrown if there is a syntax error detected in the regular expression.

search

public boolean search(String input)
Description copied from class: RegExp
Search for match.

Specified by:
search in class RegExp
Returns:
true if input matches this regular expression.

search

public boolean search(String input,
                      int start)
Description copied from class: RegExp
Search for a match in string starting at char position start

Specified by:
search in class RegExp
Returns:
true if input matches this regular expression.

search

public boolean search(char[] input,
                      int start,
                      int len)
Description copied from class: RegExp
Search for a match in char array starting at char position start with the indicated length.

Specified by:
search in class RegExp
Returns:
true if input matches this regular expression.

getResult

public RegExpResult getResult()
Description copied from class: RegExp
Returns a result object for the last call that used this RegExp for searching an input, for example match. Further calls to match do not change the RegExpResult that is returned.

Specified by:
getResult in class RegExp
Returns:
The results of the match or null if the match failed.
See Also:
RegExpResult

nGroup

public int nGroup()
Description copied from class: RegExp
Return the number of backreferences; this is the number of parenthes pairs.

Specified by:
nGroup in class RegExp
See Also:
RegExpResult.nGroup()

group

public String group(int i)
Description copied from class: RegExp
Get the ith backreference.

Specified by:
group in class RegExp
See Also:
RegExpResult.group(int)

length

public int length(int i)
Description copied from class: RegExp
The length of the corresponding backreference.

Specified by:
length in class RegExp

start

public int start(int i)
Description copied from class: RegExp
The offset from the begining of the input to the start of thespecified group.

Specified by:
start in class RegExp
See Also:
RegExpResult.start(int)

stop

public int stop(int i)
Description copied from class: RegExp
The offset from the begining of the input to the end of the specified group.

Specified by:
stop in class RegExp
See Also:
RegExpResult.stop(int)