org.jostraca.util
Class GnuRegExp

java.lang.Object
  extended byorg.jostraca.util.RegExp
      extended byorg.jostraca.util.GnuRegExp

public class GnuRegExp
extends RegExp

Facade for regular expression implementations.


Nested Class Summary
 
Nested classes inherited from class org.jostraca.util.RegExp
RegExp.Mode, RegExp.ModeSet
 
Field Summary
static java.lang.String CN
           
 
Constructor Summary
GnuRegExp(java.lang.String pMatch)
           
GnuRegExp(java.lang.String pMatch, RegExp.ModeSet pModeSet)
           
GnuRegExp(java.lang.String pSearch, java.lang.String pReplace)
           
GnuRegExp(java.lang.String pSearch, java.lang.String pReplace, RegExp.ModeSet pModeSet)
           
 
Method Summary
 java.lang.String match(java.lang.String pSource)
          Find match.
 RegExpMatch[] matchAll(java.lang.String pSource)
          find all matches
 boolean matches(java.lang.String pSource)
          Test for match.
 RegExpMatch matchFirst(java.lang.String pSource)
           
 java.lang.String matchFirstSub(java.lang.String pSource)
          get first submatch
 java.lang.String matchSecondSub(java.lang.String pSource)
          get second submatch
 java.lang.String matchSub(java.lang.String pSource, int pOrdinal)
          get nth submatch, where n = 1,2,3,...
 java.lang.String matchThirdSub(java.lang.String pSource)
          get third submatch
 java.lang.String replaceAll(java.lang.String pSource)
          replace all occurences
 java.lang.String replaceFirst(java.lang.String pSource)
          replace first occurence
 java.lang.String toString()
           
 
Methods inherited from class org.jostraca.util.RegExp
getRegExpProvider, make, make, make, make, setRegExpProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CN

public static final java.lang.String CN
Constructor Detail

GnuRegExp

public GnuRegExp(java.lang.String pMatch)
          throws RegExpException

GnuRegExp

public GnuRegExp(java.lang.String pMatch,
                 RegExp.ModeSet pModeSet)
          throws RegExpException

GnuRegExp

public GnuRegExp(java.lang.String pSearch,
                 java.lang.String pReplace)
          throws RegExpException

GnuRegExp

public GnuRegExp(java.lang.String pSearch,
                 java.lang.String pReplace,
                 RegExp.ModeSet pModeSet)
          throws RegExpException
Method Detail

replaceFirst

public java.lang.String replaceFirst(java.lang.String pSource)
                              throws RegExpException
Description copied from class: RegExp
replace first occurence

Specified by:
replaceFirst in class RegExp
Throws:
RegExpException

replaceAll

public java.lang.String replaceAll(java.lang.String pSource)
                            throws RegExpException
Description copied from class: RegExp
replace all occurences

Specified by:
replaceAll in class RegExp
Throws:
RegExpException

match

public java.lang.String match(java.lang.String pSource)
                       throws RegExpException
Description copied from class: RegExp
Find match. Returns empty String if not found.

Specified by:
match in class RegExp
Throws:
RegExpException

matches

public boolean matches(java.lang.String pSource)
                throws RegExpException
Description copied from class: RegExp
Test for match. Returns true if matches.

Specified by:
matches in class RegExp
Throws:
RegExpException

matchFirst

public RegExpMatch matchFirst(java.lang.String pSource)
                       throws RegExpException
Specified by:
matchFirst in class RegExp
Throws:
RegExpException

matchAll

public RegExpMatch[] matchAll(java.lang.String pSource)
                       throws RegExpException
Description copied from class: RegExp
find all matches

Specified by:
matchAll in class RegExp
Throws:
RegExpException

matchFirstSub

public java.lang.String matchFirstSub(java.lang.String pSource)
                               throws RegExpException
Description copied from class: RegExp
get first submatch

Specified by:
matchFirstSub in class RegExp
Throws:
RegExpException

matchSecondSub

public java.lang.String matchSecondSub(java.lang.String pSource)
                                throws RegExpException
Description copied from class: RegExp
get second submatch

Specified by:
matchSecondSub in class RegExp
Throws:
RegExpException

matchThirdSub

public java.lang.String matchThirdSub(java.lang.String pSource)
                               throws RegExpException
Description copied from class: RegExp
get third submatch

Specified by:
matchThirdSub in class RegExp
Throws:
RegExpException

matchSub

public java.lang.String matchSub(java.lang.String pSource,
                                 int pOrdinal)
                          throws RegExpException
Description copied from class: RegExp
get nth submatch, where n = 1,2,3,...

Specified by:
matchSub in class RegExp
Throws:
RegExpException

toString

public java.lang.String toString()
Specified by:
toString in class RegExp


Copyright © 2000-2002 Richard Rodger