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
-
RegExp()
- Constructs a RegExp instance.
-
RegExp(String)
- Constructs a RegExp instance with the specified regular expression.
-
getQuotedChar(char)
- Gets a quoted char.
-
globalMatch(String)
- Global pattern match.
-
globalSubstitute(String, String)
- Substitutes for all matched strings.
-
match(String)
- Pattern match with the current specified regular expression.
-
match(String, int, int)
- Pattern match with the current specified regular expreshassion.
-
matchHead(String, int, int, DState)
- Pattern match on the top of line.
-
matchInside(String, int, int, DState)
- Pattern match in the line.
-
processReplacement(String, String)
- Substitutes the matched string for '&' and processes escape sequences.
-
simpleSubstitute(String, String)
- Substitutes only one time.
-
split(String)
- Splits a text by the matched strings.
-
substitute(String, String, boolean)
- Substitutes subText for matched strings.
RegExp
public RegExp()
- Constructs a RegExp instance.
RegExp
public RegExp(String pattern) throws RegExpSyntaxException, NFABuildException
- Constructs a RegExp instance with the specified regular expression.
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.
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.
matchHead
protected int matchHead(String text,
int start,
int end,
DState state)
- Pattern match on the top of line.
matchInside
protected int matchInside(String text,
int start,
int end,
DState state)
- Pattern match in the line.
globalMatch
public MatchInfo[] globalMatch(String text)
- Global pattern match.
- Parameters:
- text - the target text.
- Returns:
- Returns Enumeration of MatchInfo.
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.
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.
simpleSubstitute
protected String simpleSubstitute(String text,
String replacement)
- Substitutes only one time.
globalSubstitute
protected String globalSubstitute(String text,
String replacement)
- Substitutes for all matched strings.
processReplacement
protected String processReplacement(String replacement,
String matchString)
- Substitutes the matched string for '&' and processes escape sequences.
getQuotedChar
protected char getQuotedChar(char c)
- Gets a quoted char.
All Packages Class Hierarchy This Package Previous Next Index