    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

##

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

##

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

##

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

##

REG_ICASE

     public static final int REG_ICASE

  Compilation flag. Do not differentiate case. Subsequent searches using this pattern buffer will be case insensitive.

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.

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.

REG_NOTBOL

     public static final int REG_NOTBOL

  Execution flag. The match-beginning operator (^) does not match at the beginning of the input string.

REG_NOTEOL

     public static final int REG_NOTEOL

  Execution flag. The match-end operator ($) does not match at the end of the input string.

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).

##

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.

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.

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.

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.

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.

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.

##

isMatch

     public boolean isMatch(String input)

  Checks if the input string in its entirety is an exact match of this regular expression.

isMatch

     public boolean isMatch(String input,
                            int index)

  Checks if the input string, starting from index, is an exact match of this regular expression.

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.

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.

getAllMatches

     public REMatch[] getAllMatches(String input)

  Returns an array of all matches found in the input string.

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.

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.

getMatch

     public REMatch getMatch(String input)

  Returns the first match found in the input string.

getMatch

     public REMatch getMatch(String input,
                             int index)

  Returns the first match found in the input string, beginning the search at the specified index.

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.

substitute

     public String substitute(String input,
                              String replace)

  Substitutes the replacement text for the first match found in the input string.

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.

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.

substituteAll

     public String substituteAll(String input,
                                 String replace)

  Substitutes the replacement text for each non-overlapping match found in the input string.

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.

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.

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