jasp.regexp
Class RegExp

java.lang.Object
  |
  +--jasp.regexp.RegExp

public class RegExp
extends java.lang.Object

Provides simple regular expression support.


Constructor Summary
RegExp()
           
 
Method Summary
 MatchCollection Execute(java.lang.String s)
          Executes a regular expression search against a specified string.
 boolean getGlobal()
          Returns a Boolean value that indicates if a pattern should match all occurrences in an entire search string or just the first one.
 java.lang.String getPattern()
          Returns the regular expression pattern.
 java.lang.String Replace(java.lang.String s1, java.lang.String s2)
          Replaces text found in a regular expression search.
 void setGlobal(boolean global)
          Sets a Boolean value that indicates if a pattern should match all occurrences in an entire search string or just the first one.
 void setIgnoreCase(boolean IgnoreCase)
          The value of the IgnoreCase property is False if the search is case-sensitive, True if it is not.
 void setPattern(java.lang.String str)
          Sets the regular expression pattern being searched for.
 boolean Test(java.lang.String s1)
          Executes a regular expression search against a specified string and returns a Boolean value that indicates if a pattern match was found.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegExp

public RegExp()
Method Detail

setPattern

public void setPattern(java.lang.String str)
                throws java.lang.Exception
Sets the regular expression pattern being searched for.
Parameters:
str - the regular expression pattern

getPattern

public java.lang.String getPattern()
Returns the regular expression pattern.

setIgnoreCase

public void setIgnoreCase(boolean IgnoreCase)
The value of the IgnoreCase property is False if the search is case-sensitive, True if it is not. Default is False.

setGlobal

public void setGlobal(boolean global)
Sets a Boolean value that indicates if a pattern should match all occurrences in an entire search string or just the first one.

getGlobal

public boolean getGlobal()
Returns a Boolean value that indicates if a pattern should match all occurrences in an entire search string or just the first one.

Test

public boolean Test(java.lang.String s1)
Executes a regular expression search against a specified string and returns a Boolean value that indicates if a pattern match was found.
Parameters:
s1 - The text string upon which the regular expression is executed.
Returns:
The Test method returns True if a pattern match is found; False if no match is found.

Replace

public java.lang.String Replace(java.lang.String s1,
                                java.lang.String s2)
Replaces text found in a regular expression search.
Parameters:
s1 - is the text string in which the text replacement is to occur.
s2 - is the replacement text string.
Returns:
The Replace method returns a copy of s1 with the text of RegExp.Pattern replaced with s2. If no match is found, a copy of s1 is returned unchanged.

Execute

public MatchCollection Execute(java.lang.String s)
Executes a regular expression search against a specified string.
Parameters:
s - The text string upon which the regular expression is executed.
Returns:
The Execute method returns a Matches collection containing a Match object for each match found in string. Execute returns an empty Matches collection if no match is found.