All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gnu.regexp.RESyntax

java.lang.Object
   |
   +----gnu.regexp.RESyntax

public class RESyntax
extends Object
An RESyntax specifies the way a regular expression will be compiled. This class provides a number of predefined useful constants for emulating popular regular expression syntaxes. Additionally the user may construct his or her own syntax, using any combination of the syntax bit constants. The syntax is an optional argument to any of the matching methods on class RE.

Author:
Wes Biggs

Variable Index

 o RE_BACKSLASH_ESCAPE_IN_LISTS
Syntax bit.
 o RE_BK_PLUS_QM
Syntax bit.
 o RE_CHAR_CLASS_ESC_IN_LISTS
Syntax bit.
 o RE_CHAR_CLASS_ESCAPES
Syntax bit.
 o RE_CHAR_CLASSES
Syntax bit.
 o RE_COMMENTS
Syntax bit.
 o RE_CONTEXT_INDEP_ANCHORS
Syntax bit.
 o RE_CONTEXT_INDEP_OPS
Syntax bit.
 o RE_CONTEXT_INVALID_OPS
Syntax bit.
 o RE_DOT_NEWLINE
Syntax bit.
 o RE_DOT_NOT_NULL
Syntax bit.
 o RE_HAT_LISTS_NOT_NEWLINE
Syntax bit.
 o RE_INTERVALS
Syntax bit.
 o RE_LIMITED_OPS
Syntax bit.
 o RE_LOOKAHEAD
Syntax bit.
 o RE_NEWLINE_ALT
Syntax bit.
 o RE_NO_BK_BRACES
Syntax bit.
 o RE_NO_BK_PARENS
Syntax bit.
 o RE_NO_BK_REFS
Syntax bit.
 o RE_NO_BK_VBAR
Syntax bit.
 o RE_NO_EMPTY_RANGES
Syntax bit.
 o RE_PURE_GROUPING
Syntax bit.
 o RE_STINGY_OPS
Syntax bit.
 o RE_STRING_ANCHORS
Syntax bit.
 o RE_SYNTAX_AWK
Predefined syntax.
 o RE_SYNTAX_ED
Predefined syntax.
 o RE_SYNTAX_EGREP
Predefined syntax.
 o RE_SYNTAX_EMACS
Predefined syntax.
 o RE_SYNTAX_GREP
Predefined syntax.
 o RE_SYNTAX_PERL4
Predefined syntax.
 o RE_SYNTAX_PERL4_S
Predefined syntax.
 o RE_SYNTAX_PERL5
Predefined syntax.
 o RE_SYNTAX_PERL5_S
Predefined syntax.
 o RE_SYNTAX_POSIX_AWK
Predefined syntax.
 o RE_SYNTAX_POSIX_BASIC
Predefined syntax.
 o RE_SYNTAX_POSIX_EGREP
Predefined syntax.
 o RE_SYNTAX_POSIX_EXTENDED
Predefined syntax.
 o RE_SYNTAX_POSIX_MINIMAL_BASIC
Predefined syntax.
 o RE_SYNTAX_POSIX_MINIMAL_EXTENDED
Predefined syntax.
 o RE_SYNTAX_SED
Predefined syntax.
 o RE_UNMATCHED_RIGHT_PAREN_ORD
Syntax bit.

Constructor Index

 o RESyntax()
Construct a new syntax object with all bits turned off.
 o RESyntax(RESyntax)
Construct a new syntax object with all bits set the same as the other syntax.

Method Index

 o get(int)
Check if a given bit is set in this syntax.
 o set(int)
Set a given bit in this syntax.

Variables

 o RE_BACKSLASH_ESCAPE_IN_LISTS
 public static final int RE_BACKSLASH_ESCAPE_IN_LISTS
Syntax bit. Backslash is an escape character in lists.

 o RE_BK_PLUS_QM
 public static final int RE_BK_PLUS_QM
Syntax bit. Use \? instead of ? and \+ instead of +.

 o RE_CHAR_CLASSES
 public static final int RE_CHAR_CLASSES
Syntax bit. POSIX character classes ([:...:]) in lists are allowed.

 o RE_CONTEXT_INDEP_ANCHORS
 public static final int RE_CONTEXT_INDEP_ANCHORS
Syntax bit. ^ and $ are special everywhere. Not implemented.

 o RE_CONTEXT_INDEP_OPS
 public static final int RE_CONTEXT_INDEP_OPS
Syntax bit. Repetition operators are only special in valid positions. Not implemented.

 o RE_CONTEXT_INVALID_OPS
 public static final int RE_CONTEXT_INVALID_OPS
Syntax bit. Repetition and alternation operators are invalid at start and end of pattern and other places. Not implemented.

 o RE_DOT_NEWLINE
 public static final int RE_DOT_NEWLINE
Syntax bit. Match-any-character operator (.) matches a newline.

 o RE_DOT_NOT_NULL
 public static final int RE_DOT_NOT_NULL
Syntax bit. Match-any-character operator (.) does not match a null.

 o RE_INTERVALS
 public static final int RE_INTERVALS
Syntax bit. Intervals ({x}, {x,}, {x,y}) are allowed.

 o RE_LIMITED_OPS
 public static final int RE_LIMITED_OPS
Syntax bit. No alternation (|), match one-or-more (+), or match zero-or-one (?) operators.

 o RE_NEWLINE_ALT
 public static final int RE_NEWLINE_ALT
Syntax bit. Newline is an alternation operator.

 o RE_NO_BK_BRACES
 public static final int RE_NO_BK_BRACES
Syntax bit. Intervals use { } instead of \{ \}

 o RE_NO_BK_PARENS
 public static final int RE_NO_BK_PARENS
Syntax bit. Grouping uses ( ) instead of \( \).

 o RE_NO_BK_REFS
 public static final int RE_NO_BK_REFS
Syntax bit. Backreferences not allowed.

 o RE_NO_BK_VBAR
 public static final int RE_NO_BK_VBAR
Syntax bit. Alternation uses | instead of \|

 o RE_NO_EMPTY_RANGES
 public static final int RE_NO_EMPTY_RANGES
Syntax bit. Not implemented.

 o RE_UNMATCHED_RIGHT_PAREN_ORD
 public static final int RE_UNMATCHED_RIGHT_PAREN_ORD
Syntax bit. An unmatched right parenthesis (')' or '\)', depending on RE_NO_BK_PARENS) will throw an exception when compiling.

 o RE_HAT_LISTS_NOT_NEWLINE
 public static final int RE_HAT_LISTS_NOT_NEWLINE
Syntax bit. Not implemented.

 o RE_STINGY_OPS
 public static final int RE_STINGY_OPS
Syntax bit. Stingy matching is allowed (+?, *?, ??, {x,y}?).

 o RE_CHAR_CLASS_ESCAPES
 public static final int RE_CHAR_CLASS_ESCAPES
Syntax bit. Allow character class escapes (\d, \D, \s, \S, \w, \W).

 o RE_PURE_GROUPING
 public static final int RE_PURE_GROUPING
Syntax bit. Allow use of (?:xxx) grouping (subexpression is not saved).

 o RE_LOOKAHEAD
 public static final int RE_LOOKAHEAD
Syntax bit. Not implemented.

 o RE_STRING_ANCHORS
 public static final int RE_STRING_ANCHORS
Syntax bit. Allow beginning- and end-of-string anchors (\A, \Z).

 o RE_COMMENTS
 public static final int RE_COMMENTS
Syntax bit. Allow embedded comments, (#comment), as in Perl5.

 o RE_CHAR_CLASS_ESC_IN_LISTS
 public static final int RE_CHAR_CLASS_ESC_IN_LISTS
Syntax bit. Allow character class escapes within lists, as in Perl5.

 o RE_SYNTAX_AWK
 public static final RESyntax RE_SYNTAX_AWK
Predefined syntax. Emulates regular expression support in the awk utility.

 o RE_SYNTAX_ED
 public static final RESyntax RE_SYNTAX_ED
Predefined syntax. Emulates regular expression support in the ed utility.

 o RE_SYNTAX_EGREP
 public static final RESyntax RE_SYNTAX_EGREP
Predefined syntax. Emulates regular expression support in the egrep utility.

 o RE_SYNTAX_EMACS
 public static final RESyntax RE_SYNTAX_EMACS
Predefined syntax. Emulates regular expression support in the GNU Emacs editor.

 o RE_SYNTAX_GREP
 public static final RESyntax RE_SYNTAX_GREP
Predefined syntax. Emulates regular expression support in the grep utility.

 o RE_SYNTAX_POSIX_AWK
 public static final RESyntax RE_SYNTAX_POSIX_AWK
Predefined syntax. Emulates regular expression support in the POSIX awk specification.

 o RE_SYNTAX_POSIX_BASIC
 public static final RESyntax RE_SYNTAX_POSIX_BASIC
Predefined syntax. Emulates POSIX basic regular expression support.

 o RE_SYNTAX_POSIX_EGREP
 public static final RESyntax RE_SYNTAX_POSIX_EGREP
Predefined syntax. Emulates regular expression support in the POSIX egrep specification.

 o RE_SYNTAX_POSIX_EXTENDED
 public static final RESyntax RE_SYNTAX_POSIX_EXTENDED
Predefined syntax. Emulates POSIX extended regular expression support.

 o RE_SYNTAX_POSIX_MINIMAL_BASIC
 public static final RESyntax RE_SYNTAX_POSIX_MINIMAL_BASIC
Predefined syntax. Emulates POSIX basic minimal regular expressions.

 o RE_SYNTAX_POSIX_MINIMAL_EXTENDED
 public static final RESyntax RE_SYNTAX_POSIX_MINIMAL_EXTENDED
Predefined syntax. Emulates POSIX extended minimal regular expressions.

 o RE_SYNTAX_SED
 public static final RESyntax RE_SYNTAX_SED
Predefined syntax. Emulates regular expression support in the sed utility.

 o RE_SYNTAX_PERL4
 public static final RESyntax RE_SYNTAX_PERL4
Predefined syntax. Emulates regular expression support in Larry Wall's perl, version 4,

 o RE_SYNTAX_PERL4_S
 public static final RESyntax RE_SYNTAX_PERL4_S
Predefined syntax. Emulates regular expression support in Larry Wall's perl, version 4, using single line mode (/s modifier).

 o RE_SYNTAX_PERL5
 public static final RESyntax RE_SYNTAX_PERL5
Predefined syntax. Emulates regular expression support in Larry Wall's perl, version 5.

 o RE_SYNTAX_PERL5_S
 public static final RESyntax RE_SYNTAX_PERL5_S
Predefined syntax. Emulates regular expression support in Larry Wall's perl, version 5, using single line mode (/s modifier).

Constructors

 o RESyntax
 public RESyntax()
Construct a new syntax object with all bits turned off. This is equivalent to RE_SYNTAX_EMACS.

 o RESyntax
 public RESyntax(RESyntax other)
Construct a new syntax object with all bits set the same as the other syntax.

Methods

 o get
 public boolean get(int index)
Check if a given bit is set in this syntax.

 o set
 public RESyntax set(int index)
Set a given bit in this syntax. Returns a reference to this syntax for easy chaining.


All Packages  Class Hierarchy  This Package  Previous  Next  Index