All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JP.ac.osaka_u.ender.util.regex.RegExp

java.lang.Object
   |
   +----JP.ac.osaka_u.ender.util.regex.RegExpCore
           |
           +----JP.ac.osaka_u.ender.util.regex.RegExp

public class RegExp
extends RegExpCore
A class that handles regular expressions.

Author:
Shugo Maeda

Constructor Index

 o RegExp()
Constructs a RegExp instance.
 o RegExp(String)
Constructs a RegExp instance with the specified regular expression.

Method Index

 o getQuotedChar(char)
Gets a quoted char.
 o globalMatch(String)
Global pattern match.
 o globalSubstitute(String, String)
Substitutes for all matched strings.
 o match(String)
Pattern match with the current specified regular expression.
 o match(String, int, int)
Pattern match with the current specified regular expreshassion.
 o matchHead(String, int, int, DState)
Pattern match on the top of line.
 o matchInside(String, int, int, DState)
Pattern match in the line.
 o processReplacement(String, String)
Substitutes the matched string for '&' and processes escape sequences.
 o simpleSubstitute(String, String)
Substitutes only one time.
 o split(String)
Splits a text by the matched strings.
 o substitute(String, String, boolean)
Substitutes subText for matched strings.

Constructors

 o RegExp
 public RegExp()
Constructs a RegExp instance.

 o RegExp
 public RegExp(String pattern) throws RegExpSyntaxException, NFABuildException
Constructs a RegExp instance with the specified regular expression.

Methods

 o match
 public MatchInfo match(String text)
Pattern match with the current specified regular expression.

Parameters:
text - the target text.
Returns:
Returns the information on pattern matching.
 o match
 public MatchInfo match(String text,
                        int begin,
                        int end)
Pattern match with the current specified regular expreshassion.

Parameters:
text - the target text.
begin - the begining index for the target.
end - the ending index for the target.
Returns:
Returns the information on pattern matching.
 o matchHead
 protected int matchHead(String text,
                         int start,
                         int end,
                         DState state)
Pattern match on the top of line.

 o matchInside
 protected int matchInside(String text,
                           int start,
                           int end,
                           DState state)
Pattern match in the line.

 o globalMatch
 public MatchInfo[] globalMatch(String text)
Global pattern match.

Parameters:
text - the target text.
Returns:
Returns Enumeration of MatchInfo.
 o split
 public String[] split(String text)
Splits a text by the matched strings.

Parameters:
text - the target text.
Returns:
Returns Enumeration of the splited texts.
 o substitute
 public String substitute(String text,
                          String replacement,
                          boolean global)
Substitutes subText for matched strings.

Parameters:
text - the target text.
subText - substitutes for matched strings.
global - if true substitutes for all matched strings.
Returns - the modified text.
 o simpleSubstitute
 protected String simpleSubstitute(String text,
                                   String replacement)
Substitutes only one time.

 o globalSubstitute
 protected String globalSubstitute(String text,
                                   String replacement)
Substitutes for all matched strings.

 o processReplacement
 protected String processReplacement(String replacement,
                                     String matchString)
Substitutes the matched string for '&' and processes escape sequences.

 o getQuotedChar
 protected char getQuotedChar(char c)
Gets a quoted char.


All Packages  Class Hierarchy  This Package  Previous  Next  Index