Class REProgram

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

public class REProgram extends Object
A class that holds compiled regular expressions. These are created using the RECompiler, and evaluated using the REMatcher.
  • Field Details

    • OPT_HASBACKREFS

      protected static final int OPT_HASBACKREFS
      See Also:
    • OPT_HASBOL

      protected static final int OPT_HASBOL
      See Also:
    • operation

      protected Operation operation
    • flags

      protected REFlags flags
    • prefix

      protected UnicodeString prefix
    • initialCharClass

      protected IntPredicateProxy initialCharClass
    • preconditions

      protected List<RegexPrecondition> preconditions
    • minimumLength

      protected int minimumLength
    • fixedLength

      protected int fixedLength
    • optimizationFlags

      protected int optimizationFlags
    • maxParens

      protected int maxParens
    • backtrackingLimit

      protected int backtrackingLimit
  • Constructor Details

    • REProgram

      public REProgram(Operation operation, int parens, REFlags flags)
      Constructs a program object
      Parameters:
      operation - The top-level operation, the root of an operation tree
      parens - Count of capturing parens in the program.
      flags - the regular expression flags
  • Method Details

    • setBacktrackingLimit

      public void setBacktrackingLimit(int limit)
    • getBacktrackingLimit

      public int getBacktrackingLimit()
    • isNullable

      public boolean isNullable()
      Ask whether the regular expression is known statically to match a zero length string
      Returns:
      true if the regex is known statically to match a zero length string. If the result is true, then there is definitely a match; if the result is false, then it is not known statically whether there is a match (this arises when the expression contains back-references).
    • 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