Package net.sf.saxon.regex
Class REProgram
- java.lang.Object
-
- net.sf.saxon.regex.REProgram
-
public class REProgram extends java.lang.Object
A class that holds compiled regular expressions.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
backtrackingLimit
(package private) int
fixedLength
(package private) REFlags
flags
(package private) java.util.function.IntPredicate
initialCharClass
(package private) int
maxParens
(package private) int
minimumLength
(package private) Operation
operation
(package private) static int
OPT_HASBACKREFS
(package private) static int
OPT_HASBOL
(package private) int
optimizationFlags
(package private) java.util.List<RegexPrecondition>
preconditions
(package private) UnicodeString
prefix
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBacktrackingLimit()
UnicodeString
getPrefix()
Returns a copy of the prefix of current regular expression program in a character array.boolean
isNullable()
Ask whether the regular expression is known statically to match a zero length stringvoid
setBacktrackingLimit(int limit)
-
-
-
Field Detail
-
OPT_HASBACKREFS
static final int OPT_HASBACKREFS
- See Also:
- Constant Field Values
-
OPT_HASBOL
static final int OPT_HASBOL
- See Also:
- Constant Field Values
-
operation
Operation operation
-
flags
REFlags flags
-
prefix
UnicodeString prefix
-
initialCharClass
java.util.function.IntPredicate initialCharClass
-
preconditions
java.util.List<RegexPrecondition> preconditions
-
minimumLength
int minimumLength
-
fixedLength
int fixedLength
-
optimizationFlags
int optimizationFlags
-
maxParens
int maxParens
-
backtrackingLimit
int backtrackingLimit
-
-
Constructor Detail
-
REProgram
public REProgram(Operation operation, int parens, REFlags flags)
Constructs a program object from a character array- Parameters:
operation
- Array with RE opcode instructions in it. The "next"parens
- Count of parens in the program pointers within the operations must already have been converted to absolute offsets.flags
- the regular expression flags
-
-
Method Detail
-
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
-
-