All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gnu.regexp.RE

java.lang.Object
   |
   +----gnu.regexp.REToken
           |
           +----gnu.regexp.RE

public class RE
extends REToken
implements Serializable

Variable Index

 o REG_ANCHORINDEX
Execution flag.
 o REG_DOT_NEWLINE
Compilation flag.
 o REG_ICASE
Compilation flag.
 o REG_MULTILINE
Compilation flag.
 o REG_NOTBOL
Execution flag.
 o REG_NOTEOL
Execution flag.

Constructor Index

 o RE(char[])
Constructs a regular expression pattern buffer.
 o RE(char[], int)
Constructs a regular expression pattern buffer.
 o RE(char[], int, RESyntax)
Constructs a regular expression pattern buffer.
 o RE(String)
Constructs a regular expression pattern buffer.
 o RE(String, int)
Constructs a regular expression pattern buffer.
 o RE(String, int, RESyntax)
Constructs a regular expression pattern buffer.

Method Index

 o getAllMatches(String)
Returns an array of all matches found in the input string.
 o getAllMatches(String, int)
Returns an array of all matches found in the input string, beginning at the specified index position.
 o getAllMatches(String, int, int)
Returns an array of all matches found in the input string, beginning at the specified index position and using the specified execution flags.
 o getMatch(String)
Returns the first match found in the input string.
 o getMatch(String, int)
Returns the first match found in the input string, beginning the search at the specified index.
 o getMatch(String, int, int)
Returns the first match found in the input string, beginning the search at the specified index, and using the specified execution flags.
 o getNumSubs()
Returns the maximum number of subexpressions in this regular expression.
 o isMatch(String)
Checks if the input string in its entirety is an exact match of this regular expression.
 o isMatch(String, int)
Checks if the input string, starting from index, is an exact match of this regular expression.
 o isMatch(String, int, int)
Checks if the input string, starting from index and using the specified execution flags, is an exact match of this regular expression.
 o substitute(String, String)
Substitutes the replacement text for the first match found in the input string.
 o substitute(String, String, int)
Substitutes the replacement text for the first match found in the input string, beginning at the specified index position.
 o substitute(String, String, int, int)
Substitutes the replacement text for the first match found in the input string, beginning at the specified index position and using the specified execution flags.
 o substituteAll(String, String)
Substitutes the replacement text for each non-overlapping match found in the input string.
 o substituteAll(String, String, int)
Substitutes the replacement text for each non-overlapping match found in the input string, starting at the specified index.
 o substituteAll(String, String, int, int)
Substitutes the replacement text for each non-overlapping match found in the input string, starting at the specified index and using the specified execution flags.
 o version()
Returns a string representing the version of the gnu.regexp package.

Variables

 o REG_ICASE
 public static final int REG_ICASE
Compilation flag. Do not differentiate case. Subsequent searches using this pattern buffer will be case insensitive.

 o REG_DOT_NEWLINE
 public static final int REG_DOT_NEWLINE
Compilation flag. The match-any-character operator (dot) will match a newline character. When set this overrides the syntax bit RE_DOT_NEWLINE (see RESyntax for details). This is equivalent to the "/s" operator in Perl.

 o REG_MULTILINE
 public static final int REG_MULTILINE
Compilation flag. Use multiline mode. In this mode, the ^ and $ anchors will match at a newline within the input string. This is equivalent to the "/m" operator in Perl.

 o REG_NOTBOL
 public static final int REG_NOTBOL
Execution flag. The match-beginning operator (^) does not match at the beginning of the input string.

 o REG_NOTEOL
 public static final int REG_NOTEOL
Execution flag. The match-end operator ($) does not match at the end of the input string.

 o REG_ANCHORINDEX
 public static final int REG_ANCHORINDEX
Execution flag. The match-beginning operator (^) matches not at position 0 in the input string, but at the position the search started at (based on the index input given to the getMatch function).

Constructors

 o RE
 public RE(String pattern) throws REException
Constructs a regular expression pattern buffer.

Parameters:
pattern - A regular expression string.
Throws: REException
The input pattern could not be parsed.
 o RE
 public RE(String pattern,
           int cflags) throws REException
Constructs a regular expression pattern buffer.

Parameters:
pattern - A regular expression string.
cflags - The logical OR of any combination of the compilation flags listed above.
Throws: REException
The input pattern could not be parsed.
 o RE
 public RE(String pattern,
           int cflags,
           RESyntax syntax) throws REException
Constructs a regular expression pattern buffer.

Parameters:
pattern - A regular expression string.
cflags - The logical OR of any combination of the compilation flags listed above.
syntax - The type of regular expression syntax to use.
Throws: REException
The input pattern could not be parsed.
 o RE
 public RE(char pattern[]) throws REException
Constructs a regular expression pattern buffer.

Parameters:
pattern - A regular expression represented as a character array.
Throws: REException
The input pattern could not be parsed.
 o RE
 public RE(char pattern[],
           int cflags) throws REException
Constructs a regular expression pattern buffer.

Parameters:
pattern - A regular expression represented as a character array.
cflags - The logical OR of any combination of the compilation flags listed above.
Throws: REException
The input pattern could not be parsed.
 o RE
 public RE(char pattern[],
           int cflags,
           RESyntax syntax) throws REException
Constructs a regular expression pattern buffer.

Parameters:
pattern - A regular expression represented as a character array.
cflags - The logical OR of any combination of the compilation flags listed above.
Throws: REException
The input pattern could not be parsed.

Methods

 o isMatch
 public boolean isMatch(String input)
Checks if the input string in its entirety is an exact match of this regular expression.

 o isMatch
 public boolean isMatch(String input,
                        int index)
Checks if the input string, starting from index, is an exact match of this regular expression.

 o isMatch
 public boolean isMatch(String input,
                        int index,
                        int eflags)
Checks if the input string, starting from index and using the specified execution flags, is an exact match of this regular expression.

 o getNumSubs
 public int getNumSubs()
Returns the maximum number of subexpressions in this regular expression. If the expression contains branches, the value returned will be the maximum subexpressions in any of the branches.

 o getAllMatches
 public REMatch[] getAllMatches(String input)
Returns an array of all matches found in the input string.

 o getAllMatches
 public REMatch[] getAllMatches(String input,
                                int index)
Returns an array of all matches found in the input string, beginning at the specified index position.

 o getAllMatches
 public REMatch[] getAllMatches(String input,
                                int index,
                                int eflags)
Returns an array of all matches found in the input string, beginning at the specified index position and using the specified execution flags.

 o getMatch
 public REMatch getMatch(String input)
Returns the first match found in the input string.

 o getMatch
 public REMatch getMatch(String input,
                         int index)
Returns the first match found in the input string, beginning the search at the specified index.

 o getMatch
 public REMatch getMatch(String input,
                         int index,
                         int eflags)
Returns the first match found in the input string, beginning the search at the specified index, and using the specified execution flags. If no match is found, returns null.

 o substitute
 public String substitute(String input,
                          String replace)
Substitutes the replacement text for the first match found in the input string.

 o substitute
 public String substitute(String input,
                          String replace,
                          int index)
Substitutes the replacement text for the first match found in the input string, beginning at the specified index position.

 o substitute
 public String substitute(String input,
                          String replace,
                          int index,
                          int eflags)
Substitutes the replacement text for the first match found in the input string, beginning at the specified index position and using the specified execution flags.

 o substituteAll
 public String substituteAll(String input,
                             String replace)
Substitutes the replacement text for each non-overlapping match found in the input string.

 o substituteAll
 public String substituteAll(String input,
                             String replace,
                             int index)
Substitutes the replacement text for each non-overlapping match found in the input string, starting at the specified index.

 o substituteAll
 public String substituteAll(String input,
                             String replace,
                             int index,
                             int eflags)
Substitutes the replacement text for each non-overlapping match found in the input string, starting at the specified index and using the specified execution flags.

 o version
 public static String version()
Returns a string representing the version of the gnu.regexp package.


All Packages  Class Hierarchy  This Package  Previous  Next  Index