net.sf.saxon.regex

## Class REProgram

- java.lang.Object
- - net.sf.saxon.regex.REProgram

- All Implemented Interfaces:
    Serializable

      public class REProgram
      extends Object
      implements Serializable

  A class that holds compiled regular expressions.
  Version:
    $Id: REProgram.java 518156 2007-03-14 14:31:26Z vgritsenko $
  Author:
    Jonathan Locke
  See Also:
    `REMatcher`, `RECompiler`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `REProgram(Operation[] instructions, int parens, REFlags flags)` Constructs a program object from a character array

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `display(PrintStream out)` Output a human-readable printout of the program
    `UnicodeString` | `getPrefix()` Returns a copy of the prefix of current regular expression program in a character array.
    `boolean` | `isNullable()` Ask whether the regular expression matches a zero length string
    `void` | `setNullable(boolean nullable)` Say whether the regular expression matches a zero length string

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### REProgram

          public REProgram(Operation[] instructions,
                   int parens,
                   REFlags flags)

      Constructs a program object from a character array
      Parameters:
        `parens` - Count of parens in the program
        `instructions` - Array with RE opcode instructions in it. The "next" pointers within the operations must already have been converted to absolute offsets.

  - ### Method Detail

    - #### isNullable

          public boolean isNullable()

      Ask whether the regular expression matches a zero length string
      Returns:
        true if the regex matches a zero length string

    - #### setNullable

          public void setNullable(boolean nullable)

      Say whether the regular expression matches a zero length string
      Parameters:
        `nullable` - true if the regex matches a zero length string

    - #### getPrefix

          public UnicodeString getPrefix()

      Returns a copy of the prefix of current regular expression program in a character array. If there is no prefix, or there is no program compiled yet, `getPrefix` will return null.
      Returns:
        A copy of the prefix of current compiled RE program

    - #### display

          public void display(PrintStream out)

      Output a human-readable printout of the program

Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.